| Aaron Ballman | a670c20 | 2014-05-29 16:39:42 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -x cuda -std=c++11 -DCUDA %s |
| Yaxun Liu | 382d355 | 2016-04-26 19:25:46 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -x cl -DOPENCL %s |
| Yaxun Liu | b5044fe | 2016-06-17 17:19:28 +0000 | [diff] [blame] | 3 | // 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 Liu | 382d355 | 2016-04-26 19:25:46 +0000 | [diff] [blame] | 7 | // 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 Ballman | a670c20 | 2014-05-29 16:39:42 +0000 | [diff] [blame] | 15 | |
| 16 | #if defined(CUDA) |
| 17 | __attribute__((device)) void f_device(); |
| 18 | #elif defined(OPENCL) |
| 19 | kernel void func(void); |
| 20 | #endif |