brintos

brintos / llvm-project-archived public Read only

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