| 1 | // RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fcuda-is-device -fsyntax-only -verify %s |
| 2 | |
| 3 | #include "Inputs/cuda.h" |
| 4 | |
| 5 | // Here we should dump an error about the VLA in device_fn, but we should not |
| 6 | // print a callstack indicating how device_fn becomes known-emitted, because |
| 7 | // it's an error to use a VLA in any __device__ function, even one that doesn't |
| 8 | // get emitted. |
| 9 | |
| 10 | inline __device__ void device_fn(int n); |
| 11 | inline __device__ void device_fn2() { device_fn(42); } |
| 12 | |
| 13 | __global__ void kernel() { device_fn2(); } |
| 14 | |
| 15 | inline __device__ void device_fn(int n) { |
| 16 | int vla[n]; // expected-error {{variable-length array}} |
| 17 | } |
| 18 | |