1 // RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fcuda-is-device -verify -Wno-vla %s
2 // RUN: %clang_cc1 -triple x86_64-unknown-linux -verify -DHOST -Wno-vla %s
5 // expected-no-diagnostics
8 #include "Inputs/cuda.h"
14 __device__ void device(int n) {
17 // expected-error@-2 {{cannot use variable-length arrays in __device__ functions}}
21 __host__ __device__ void hd(int n) {
24 // expected-error@-2 {{cannot use variable-length arrays in __host__ __device__ functions}}
28 // No error because never codegen'ed for device.
29 __host__ __device__ inline void hd_inline(int n) {
32 void call_hd_inline() { hd_inline(42); }