[clang] a41b510 - [HIP-Clang, test] Fix use of undef FileCheck var

Thomas Preud'homme via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 4 11:30:25 PDT 2021


Author: Thomas Preud'homme
Date: 2021-04-04T19:30:27+01:00
New Revision: a41b5100e43810694c09469bc725f560e7ef239f

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

LOG: [HIP-Clang, test] Fix use of undef FileCheck var

Commit 8129521318accc44c2a009647572f6ebd3fc56dd changed a line defining
PREFIX in clang test CodeGenCUDA/device-stub.cu into a CHECK-NOT
directive. All following lines using PREFIX are therefore using an
undefined variable since the pattern defining PREFIX is not supposed to
occur and CHECK-NOT are checked independently.

This commit replaces all uses of PREFIX by the regex used to define it,
thereby avoiding the problem.

Reviewed By: yaxunl

Differential Revision: https://reviews.llvm.org/D99831

Added: 
    

Modified: 
    clang/test/CodeGenCUDA/device-stub.cu

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGenCUDA/device-stub.cu b/clang/test/CodeGenCUDA/device-stub.cu
index e1fa931a13da9..9bac4e81a54a2 100644
--- a/clang/test/CodeGenCUDA/device-stub.cu
+++ b/clang/test/CodeGenCUDA/device-stub.cu
@@ -266,13 +266,13 @@ void hostfunc(void) { kernelfunc<<<1, 1>>>(1, 1, 1); }
 // CUDANOGLOBALS-NOT: @{{.*}} = private constant{{.*}}
 // HIPNOGLOBALS-NOT: @{{.*}} = internal constant{{.*}}
 // NOGLOBALS-NOT: define internal void @__{{.*}}_register_globals
-// NOGLOBALS-NOT: define internal void @__[[PREFIX:cuda|hip]]_module_ctor
-// NOGLOBALS-NOT: call{{.*}}[[PREFIX]]RegisterFatBinary{{.*}}__[[PREFIX]]_fatbin_wrapper
-// NOGLOBALS-NOT: call void @__[[PREFIX]]_register_globals
-// NOGLOBALS-NOT: define internal void @__[[PREFIX]]_module_dtor
-// NOGLOBALS-NOT: call void @__[[PREFIX]]UnregisterFatBinary
+// NOGLOBALS-NOT: define internal void @__{{cuda|hip}}_module_ctor
+// NOGLOBALS-NOT: call{{.*}}{{cuda|hip}}RegisterFatBinary{{.*}}__{{cuda|hip}}_fatbin_wrapper
+// NOGLOBALS-NOT: call void @__{{cuda|hip}}_register_globals
+// NOGLOBALS-NOT: define internal void @__{{cuda|hip}}_module_dtor
+// NOGLOBALS-NOT: call void @__{{cuda|hip}}UnregisterFatBinary
 
 // There should be no constructors/destructors if we have no GPU binary.
-// NOGPUBIN-NOT: define internal void @__[[PREFIX]]_register_globals
-// NOGPUBIN-NOT: define internal void @__[[PREFIX]]_module_ctor
-// NOGPUBIN-NOT: define internal void @__[[PREFIX]]_module_dtor
+// NOGPUBIN-NOT: define internal void @__{{cuda|hip}}_register_globals
+// NOGPUBIN-NOT: define internal void @__{{cuda|hip}}_module_ctor
+// NOGPUBIN-NOT: define internal void @__{{cuda|hip}}_module_dtor


        


More information about the cfe-commits mailing list