[clang] ac20150 - [CUDA] make the test more hermetic

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 17 15:24:39 PDT 2020


Author: Artem Belevich
Date: 2020-06-17T15:22:45-07:00
New Revision: ac20150e299a41ade860f432741c1b8557ac8058

URL: https://github.com/llvm/llvm-project/commit/ac20150e299a41ade860f432741c1b8557ac8058
DIFF: https://github.com/llvm/llvm-project/commit/ac20150e299a41ade860f432741c1b8557ac8058.diff

LOG: [CUDA] make the test more hermetic

Otherwise the -Werror tests fail if the locally installed CUDA version found by
the driver is newer than 10.1 and produces a warning.

Added: 
    

Modified: 
    clang/test/Driver/cuda-simple.cu

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/cuda-simple.cu b/clang/test/Driver/cuda-simple.cu
index 54e18403108b..cc5f6ea885f8 100644
--- a/clang/test/Driver/cuda-simple.cu
+++ b/clang/test/Driver/cuda-simple.cu
@@ -1,10 +1,12 @@
 // Verify that we can parse a simple CUDA file with or without -save-temps
 // http://llvm.org/PR22936
-// RUN: %clang -nocudainc -nocudalib -Werror -fsyntax-only -c %s
+// RUN: %clang --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
+// RUN:        -nocudainc -nocudalib -Werror -fsyntax-only -c %s
 //
 // Verify that we pass -x cuda-cpp-output to compiler after
 // preprocessing a CUDA file
-// RUN: %clang  -Werror -### -save-temps -c %s 2>&1 | FileCheck %s
+// RUN: %clang --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
+// RUN:        -Werror -### -save-temps -c %s 2>&1 | FileCheck %s
 // CHECK-LABEL: "-cc1"
 // CHECK: "-E"
 // CHECK: "-x" "cuda"
@@ -12,7 +14,8 @@
 // CHECK: "-x" "cuda-cpp-output"
 //
 // Verify that compiler accepts CUDA syntax with "-x cuda-cpp-output".
-// RUN: %clang -Werror -fsyntax-only -x cuda-cpp-output -c %s
+// RUN: %clang --cuda-path=%S/Inputs/CUDA/usr/local/cuda \
+// RUN:        -Werror -fsyntax-only -x cuda-cpp-output -c %s
 
 extern "C" int cudaConfigureCall(int, int);
 extern "C" int __cudaPushCallConfiguration(int, int);
@@ -22,4 +25,3 @@ __attribute__((global)) void kernel() {}
 void func() {
      kernel<<<1,1>>>();
 }
-


        


More information about the cfe-commits mailing list