From: Thomas Preud'homme Date: Sat, 3 Apr 2021 08:13:11 +0000 (+0100) Subject: [HIP-Clang, test] Fix use of undef FileCheck var X-Git-Tag: llvmorg-14-init~10485 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a41b5100e43810694c09469bc725f560e7ef239f;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/clang/test/CodeGenCUDA/device-stub.cu b/clang/test/CodeGenCUDA/device-stub.cu index e1fa931..9bac4e8 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