blob: 9c3c3078aaf2a24d31ed9fee826638c89cfcf8f5 [file] [log] [blame]
Aaron Ballmana670c202014-05-29 16:39:42 +00001// RUN: %clang_cc1 -x cuda -std=c++11 -DCUDA %s
Yaxun Liu382d3552016-04-26 19:25:46 +00002// RUN: %clang_cc1 -x cl -DOPENCL %s
Yaxun Liub5044fe2016-06-17 17:19:28 +00003// RUN: %clang_cc1 -x cl -cl-std=cl -DOPENCL %s
4// RUN: %clang_cc1 -x cl -cl-std=cl1.1 -DOPENCL %s
5// RUN: %clang_cc1 -x cl -cl-std=cl1.2 -DOPENCL %s
6// RUN: %clang_cc1 -x cl -cl-std=cl2.0 -DOPENCL %s
Yaxun Liu382d3552016-04-26 19:25:46 +00007// RUN: %clang_cc1 -x cl -cl-std=CL -DOPENCL %s
8// RUN: %clang_cc1 -x cl -cl-std=CL1.1 -DOPENCL %s
9// RUN: %clang_cc1 -x cl -cl-std=CL1.2 -DOPENCL %s
10// RUN: %clang_cc1 -x cl -cl-std=CL2.0 -DOPENCL %s
11// RUN: not %clang_cc1 -x cl -std=c99 -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-C99 %s
12// RUN: not %clang_cc1 -x cl -cl-std=invalid -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-INVALID %s
13// CHECK-C99: error: invalid argument '-std=c99' not allowed with 'OpenCL'
14// CHECK-INVALID: error: invalid value 'invalid' in '-cl-std=invalid'
Aaron Ballmana670c202014-05-29 16:39:42 +000015
16#if defined(CUDA)
17 __attribute__((device)) void f_device();
18#elif defined(OPENCL)
19 kernel void func(void);
20#endif