1
1
// REQUIRES: x86-registered-target
2
2
// REQUIRES: nvptx-registered-target
3
3
// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fcuda-is-device -fsyntax-only \
4
- // RUN: -verify -DEXPECT_VA_ARG_ERR -DEXPECT_VARARG_ERR %s
4
+ // RUN: -verify -DEXPECT_VA_ARG_ERR %s
5
5
// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fcuda-is-device -fsyntax-only \
6
6
// RUN: -fcuda-allow-variadic-functions -verify -DEXPECT_VA_ARG_ERR %s
7
- // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -verify \
8
- // RUN: -DEXPECT_VARARG_ERR %s
9
7
10
8
#include < stdarg.h>
11
9
#include " Inputs/cuda.h"
@@ -30,28 +28,15 @@ __device__ void baz() {
30
28
#endif
31
29
}
32
30
33
- __device__ void vararg (const char * x, ...) {}
34
- #ifdef EXPECT_VARARG_ERR
35
- // expected-error@-2 {{CUDA device code does not support variadic functions}}
36
- #endif
31
+ __device__ void vararg (const char * x, ...) {} // OK
37
32
38
33
template <typename T>
39
- __device__ void vararg (T t, ...) {}
40
- #ifdef EXPECT_VARARG_ERR
41
- // expected-error@-2 {{CUDA device code does not support variadic functions}}
42
- #endif
34
+ __device__ void vararg (T t, ...) {} // OK
43
35
44
36
extern " C" __device__ int printf (const char * fmt, ...); // OK, special case.
45
37
46
- // Definition of printf not allowed.
47
- extern " C" __device__ int printf (const char * fmt, ...) { return 0 ; }
48
- #ifdef EXPECT_VARARG_ERR
49
- // expected-error@-2 {{CUDA device code does not support variadic functions}}
50
- #endif
38
+ extern " C" __device__ int printf (const char * fmt, ...) { return 0 ; } // OK
51
39
52
40
namespace ns {
53
- __device__ int printf (const char * fmt, ...);
54
- #ifdef EXPECT_VARARG_ERR
55
- // expected-error@-2 {{CUDA device code does not support variadic functions}}
56
- #endif
41
+ __device__ int printf (const char * fmt, ...); // OK
57
42
}
0 commit comments