1 // RUN: %clang_cc1 -fopenmp -x c -triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm-bc %s -o %t-x86-host.bc
2 // RUN: %clang_cc1 -verify -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only
3 // RUN: %clang_cc1 -verify -DDIAGS -DIMMEDIATE -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only
4 // RUN: %clang_cc1 -verify -DDIAGS -DDELAYED -fopenmp -x c -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -fsyntax-only
5 // REQUIRES: x86-registered-target
6 // REQUIRES: nvptx-registered-target
9 // expected-no-diagnostics
12 void foo(int r
, ...) {
14 // expected-error@+4 {{CUDA device code does not support va_arg}}
16 __builtin_va_list list
;
17 __builtin_va_start(list
, r
);
18 (void)__builtin_va_arg(list
, int);
19 __builtin_va_end(list
);
22 #pragma omp declare target to(foo)
26 #pragma omp declare target
30 // expected-error@+4 {{CUDA device code does not support va_arg}}
32 __builtin_va_list list
;
33 __builtin_va_start(list
, r
);
34 (void)__builtin_va_arg(list
, int);
35 __builtin_va_end(list
);
39 #pragma omp end declare target
48 // expected-note@+2 {{called by 'main'}}