Home | History | Annotate | Download | only in Preprocessor
      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 
     16 // RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 -nocudainc %s 2>&1 \
     17 // RUN:   | FileCheck -check-prefix NOARCH %s
     18 // RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 --cuda-host-only -nocudainc %s 2>&1 \
     19 // RUN:   | FileCheck -check-prefix NOARCH %s
     20 // NOARCH: clang_unittest_no_arch
     21 
     22 // RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_20 --cuda-device-only -nocudainc %s 2>&1 \
     23 // RUN:   | FileCheck -check-prefix SM20 %s
     24 // SM20: clang_unittest_cuda_arch 200
     25 
     26 // RUN: %clang -E -target x86_64-linux-gnu --cuda-gpu-arch=sm_30 --cuda-device-only -nocudainc %s 2>&1 \
     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 \
     31 // RUN:   --cuda-device-only -nocudainc %s 2>&1 \
     32 // RUN:   | FileCheck -check-prefix SM20 -check-prefix SM30 %s
     33