Clang Project

clang_source_code/test/Driver/cuda-simple.cu
1// Verify that we can parse a simple CUDA file with or without -save-temps
2// http://llvm.org/PR22936
3// RUN: %clang -nocudainc -nocudalib -Werror -fsyntax-only -c %s
4//
5// Verify that we pass -x cuda-cpp-output to compiler after
6// preprocessing a CUDA file
7// RUN: %clang  -Werror -### -save-temps -c %s 2>&1 | FileCheck %s
8// CHECK: "-cc1"
9// CHECK: "-E"
10// CHECK: "-x" "cuda"
11// CHECK-NEXT: "-cc1"
12// CHECK: "-x" "cuda-cpp-output"
13//
14// Verify that compiler accepts CUDA syntax with "-x cuda-cpp-output".
15// RUN: %clang -Werror -fsyntax-only -x cuda-cpp-output -c %s
16
17extern "C" int cudaConfigureCall(int, int);
18extern "C" int __cudaPushCallConfiguration(int, int);
19
20__attribute__((global)) void kernel() {}
21
22void func() {
23     kernel<<<1,1>>>();
24}
25
26