diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Driver/cuda-options.cu | 109 | ||||
-rw-r--r-- | clang/test/Index/attributes-cuda.cu | 22 | ||||
-rw-r--r-- | clang/test/Index/index-file.cu | 9 |
3 files changed, 10 insertions, 130 deletions
diff --git a/clang/test/Driver/cuda-options.cu b/clang/test/Driver/cuda-options.cu deleted file mode 100644 index ecb3f228eab..00000000000 --- a/clang/test/Driver/cuda-options.cu +++ /dev/null @@ -1,109 +0,0 @@ -// Tests CUDA compilation pipeline construction in Driver. -// REQUIRES: clang-driver - -// Simple compilation case: -// RUN: %clang -### -c %s 2>&1 \ -// Compile device-side to PTX assembly and make sure we use it on the host side. -// RUN: | FileCheck -check-prefix CUDA-D1 \ -// Then compile host side and incorporate device code. -// RUN: -check-prefix CUDA-H -check-prefix CUDA-H-I1 \ -// Make sure we don't link anything. -// RUN: -check-prefix CUDA-NL %s - -// Typical compilation + link case: -// RUN: %clang -### %s 2>&1 \ -// Compile device-side to PTX assembly and make sure we use it on the host side -// RUN: | FileCheck -check-prefix CUDA-D1 \ -// Then compile host side and incorporate device code. -// RUN: -check-prefix CUDA-H -check-prefix CUDA-H-I1 \ -// Then link things. -// RUN: -check-prefix CUDA-L %s - -// Verify that -cuda-no-device disables device-side compilation and linking -// RUN: %clang -### --cuda-host-only %s 2>&1 \ -// Make sure we didn't run device-side compilation. -// RUN: | FileCheck -check-prefix CUDA-ND \ -// Then compile host side and make sure we don't attempt to incorporate GPU code. -// RUN: -check-prefix CUDA-H -check-prefix CUDA-H-NI \ -// Make sure we don't link anything. -// RUN: -check-prefix CUDA-NL %s - -// Verify that -cuda-no-host disables host-side compilation and linking -// RUN: %clang -### --cuda-device-only %s 2>&1 \ -// Compile device-side to PTX assembly -// RUN: | FileCheck -check-prefix CUDA-D1 \ -// Make sure there are no host cmpilation or linking. -// RUN: -check-prefix CUDA-NH -check-prefix CUDA-NL %s - -// Verify that with -S we compile host and device sides to assembly -// and incorporate device code on the host side. -// RUN: %clang -### -S -c %s 2>&1 \ -// Compile device-side to PTX assembly -// RUN: | FileCheck -check-prefix CUDA-D1 \ -// Then compile host side and incorporate GPU code. -// RUN: -check-prefix CUDA-H -check-prefix CUDA-H-I1 \ -// Make sure we don't link anything. -// RUN: -check-prefix CUDA-NL %s - -// Verify that --cuda-gpu-arch option passes correct GPU -// archtecture info to device compilation. -// RUN: %clang -### --cuda-gpu-arch=sm_35 -c %s 2>&1 \ -// Compile device-side to PTX assembly. -// RUN: | FileCheck -check-prefix CUDA-D1 -check-prefix CUDA-D1-SM35 \ -// Then compile host side and incorporate GPU code. -// RUN: -check-prefix CUDA-H -check-prefix CUDA-H-I1 \ -// Make sure we don't link anything. -// RUN: -check-prefix CUDA-NL %s - -// Verify that there is device-side compilation per --cuda-gpu-arch args -// and that all results are included on the host side. -// RUN: %clang -### --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 -c %s 2>&1 \ -// Compile both device-sides to PTX assembly -// RUN: | FileCheck \ -// RUN: -check-prefix CUDA-D1 -check-prefix CUDA-D1-SM35 \ -// RUN: -check-prefix CUDA-D2 -check-prefix CUDA-D2-SM30 \ -// Then compile host side and incorporate both device-side outputs -// RUN: -check-prefix CUDA-H -check-prefix CUDA-H-I1 -check-prefix CUDA-H-I2 \ -// Make sure we don't link anything. -// RUN: -check-prefix CUDA-NL %s - -// Match device-side compilation -// CUDA-D1: "-cc1" "-triple" "nvptx{{(64)?}}-nvidia-cuda" -// CUDA-D1-SAME: "-fcuda-is-device" -// CUDA-D1-SM35-SAME: "-target-cpu" "sm_35" -// CUDA-D1-SAME: "-o" "[[GPUBINARY1:[^"]*]]" -// CUDA-D1-SAME: "-x" "cuda" - -// Match anothe device-side compilation -// CUDA-D2: "-cc1" "-triple" "nvptx{{(64)?}}-nvidia-cuda" -// CUDA-D2-SAME: "-fcuda-is-device" -// CUDA-D2-SM30-SAME: "-target-cpu" "sm_30" -// CUDA-D2-SAME: "-o" "[[GPUBINARY2:[^"]*]]" -// CUDA-D2-SAME: "-x" "cuda" - -// Match no device-side compilation -// CUDA-ND-NOT: "-cc1" "-triple" "nvptx{{64?}}-nvidia-cuda" -// CUDA-ND-SAME-NOT: "-fcuda-is-device" - -// Match host-side compilation -// CUDA-H: "-cc1" "-triple" -// CUDA-H-SAME-NOT: "nvptx{{64?}}-nvidia-cuda" -// CUDA-H-SAME-NOT: "-fcuda-is-device" -// CUDA-H-SAME: "-o" "[[HOSTOBJ:[^"]*]]" -// CUDA-H-SAME: "-x" "cuda" -// CUDA-H-I1-SAME: "-fcuda-include-gpubinary" "[[GPUBINARY1]]" -// CUDA-H-I2-SAME: "-fcuda-include-gpubinary" "[[GPUBINARY2]]" - -// Match no GPU code inclusion. -// CUDA-H-NI-NOT: "-fcuda-include-gpubinary" - -// Match no CUDA compilation -// CUDA-NH-NOT: "-cc1" "-triple" -// CUDA-NH-SAME-NOT: "-x" "cuda" - -// Match linker -// CUDA-L: "{{.*}}ld{{(.exe)?}}" -// CUDA-L-SAME: "[[HOSTOBJ]]" - -// Match no linker -// CUDA-NL-NOT: "{{.*}}ld{{(.exe)?}}" diff --git a/clang/test/Index/attributes-cuda.cu b/clang/test/Index/attributes-cuda.cu index 51f4aedd198..824bdb4c883 100644 --- a/clang/test/Index/attributes-cuda.cu +++ b/clang/test/Index/attributes-cuda.cu @@ -1,6 +1,4 @@ // RUN: c-index-test -test-load-source all -x cuda %s | FileCheck %s -// RUN: c-index-test -test-load-source all -x cuda --cuda-host-only %s | FileCheck %s -// RUN: c-index-test -test-load-source all -x cuda --cuda-device-only %s | FileCheck %s __attribute__((device)) void f_device(); __attribute__((global)) void f_global(); @@ -8,13 +6,13 @@ __attribute__((constant)) int* g_constant; __attribute__((shared)) float *g_shared; __attribute__((host)) void f_host(); -// CHECK: attributes-cuda.cu:5:30: FunctionDecl=f_device:5:30 -// CHECK-NEXT: attributes-cuda.cu:5:16: attribute(device) -// CHECK: attributes-cuda.cu:6:30: FunctionDecl=f_global:6:30 -// CHECK-NEXT: attributes-cuda.cu:6:16: attribute(global) -// CHECK: attributes-cuda.cu:7:32: VarDecl=g_constant:7:32 (Definition) -// CHECK-NEXT: attributes-cuda.cu:7:16: attribute(constant) -// CHECK: attributes-cuda.cu:8:32: VarDecl=g_shared:8:32 (Definition) -// CHECK-NEXT: attributes-cuda.cu:8:16: attribute(shared) -// CHECK: attributes-cuda.cu:9:28: FunctionDecl=f_host:9:28 -// CHECK-NEXT: attributes-cuda.cu:9:16: attribute(host) +// CHECK: attributes-cuda.cu:3:30: FunctionDecl=f_device:3:30 +// CHECK-NEXT: attributes-cuda.cu:3:16: attribute(device) +// CHECK: attributes-cuda.cu:4:30: FunctionDecl=f_global:4:30 +// CHECK-NEXT: attributes-cuda.cu:4:16: attribute(global) +// CHECK: attributes-cuda.cu:5:32: VarDecl=g_constant:5:32 (Definition) +// CHECK-NEXT: attributes-cuda.cu:5:16: attribute(constant) +// CHECK: attributes-cuda.cu:6:32: VarDecl=g_shared:6:32 (Definition) +// CHECK-NEXT: attributes-cuda.cu:6:16: attribute(shared) +// CHECK: attributes-cuda.cu:7:28: FunctionDecl=f_host:7:28 +// CHECK-NEXT: attributes-cuda.cu:7:16: attribute(host) diff --git a/clang/test/Index/index-file.cu b/clang/test/Index/index-file.cu deleted file mode 100644 index 26b93f06945..00000000000 --- a/clang/test/Index/index-file.cu +++ /dev/null @@ -1,9 +0,0 @@ -// Make sure we can process CUDA file even if driver creates multiple jobs -// RUN: c-index-test -test-load-source all %s | FileCheck %s -check-prefix=CHECK-ANY -// Make sure we process correct side of cuda compilation -// RUN: c-index-test -test-load-source all --cuda-host-only %s | FileCheck %s -check-prefix=CHECK-HOST -// RUN: c-index-test -test-load-source all --cuda-device-only %s | FileCheck %s -check-prefix=CHECK-DEVICE - -// CHECK-ANY: macro definition=__cplusplus -// CHECK-HOST-NOT: macro definition=__CUDA_ARCH__ -// CHECK-DEVICE: macro definition=__CUDA_ARCH__ |