Justin Lebar | 2b187c3 | 2016-01-14 21:41:18 +0000 | [diff] [blame] | 1 | // Tests CUDA compilation with -E. |
| 2 | |
| 3 | // REQUIRES: clang-driver |
| 4 | // REQUIRES: x86-registered-target |
| 5 | // REQUIRES: nvptx-registered-target |
| 6 | |
| 7 | #ifndef __CUDA_ARCH__ |
| 8 | #define PREPROCESSED_AWAY |
| 9 | clang_unittest_no_arch PREPROCESSED_AWAY |
| 10 | #else |
| 11 | clang_unittest_cuda_arch __CUDA_ARCH__ |
| 12 | #endif |
| 13 | |
| 14 | // CHECK-NOT: PREPROCESSED_AWAY |
| 15 | |
Samuel Antao | e57ad2a | 2016-02-04 08:13:16 +0000 | [diff] [blame] | 16 | // RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 -nocudainc %s 2>&1 \ |
Justin Lebar | 2b187c3 | 2016-01-14 21:41:18 +0000 | [diff] [blame] | 17 | // RUN: | FileCheck -check-prefix NOARCH %s |
Samuel Antao | e57ad2a | 2016-02-04 08:13:16 +0000 | [diff] [blame] | 18 | // RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 --cuda-host-only -nocudainc %s 2>&1 \ |
Justin Lebar | 2b187c3 | 2016-01-14 21:41:18 +0000 | [diff] [blame] | 19 | // RUN: | FileCheck -check-prefix NOARCH %s |
| 20 | // NOARCH: clang_unittest_no_arch |
| 21 | |
Samuel Antao | e57ad2a | 2016-02-04 08:13:16 +0000 | [diff] [blame] | 22 | // RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 --cuda-device-only -nocudainc %s 2>&1 \ |
Justin Lebar | 2b187c3 | 2016-01-14 21:41:18 +0000 | [diff] [blame] | 23 | // RUN: | FileCheck -check-prefix SM20 %s |
| 24 | // SM20: clang_unittest_cuda_arch 200 |
| 25 | |
Samuel Antao | e57ad2a | 2016-02-04 08:13:16 +0000 | [diff] [blame] | 26 | // RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_30 --cuda-device-only -nocudainc %s 2>&1 \ |
Justin Lebar | 2b187c3 | 2016-01-14 21:41:18 +0000 | [diff] [blame] | 27 | // RUN: | FileCheck -check-prefix SM30 %s |
| 28 | // SM30: clang_unittest_cuda_arch 300 |
| 29 | |
| 30 | // RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 --cuda-gpu-arch=sm_30 \ |
Samuel Antao | e57ad2a | 2016-02-04 08:13:16 +0000 | [diff] [blame] | 31 | // RUN: --cuda-device-only -nocudainc %s 2>&1 \ |
Justin Lebar | 2b187c3 | 2016-01-14 21:41:18 +0000 | [diff] [blame] | 32 | // RUN: | FileCheck -check-prefix SM20 -check-prefix SM30 %s |