[PATCH] D99857: [OpenCL, test] Fix use of undef FileCheck var

Thomas Preud'homme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 4 00:38:38 PDT 2021


thopre created this revision.
thopre added reviewers: hliao, craig.topper, neil.hickey, yaxunl, baldrick.
Herald added subscribers: ldrumm, Anastasia.
thopre requested review of this revision.
Herald added a project: clang.

Clang test CodeGenOpenCL/fpmath.cl uses a variable defined in an earlier
CHECK-NOT directive. However, by definition the pattern in that
directive is not supposed to occur so no variable will be defined. This
commit solves the issue by using a regex match with the same regex as in
the definition. It also changes the definition into a regex match since
no variable is going to be defined.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99857

Files:
  clang/test/CodeGenOpenCL/fpmath.cl


Index: clang/test/CodeGenOpenCL/fpmath.cl
===================================================================
--- clang/test/CodeGenOpenCL/fpmath.cl
+++ clang/test/CodeGenOpenCL/fpmath.cl
@@ -9,7 +9,7 @@
   // CHECK: @spscalardiv
   // CHECK: fdiv{{.*}},
   // NODIVOPT: !fpmath ![[MD:[0-9]+]]
-  // DIVOPT-NOT: !fpmath ![[MD:[0-9]+]]
+  // DIVOPT-NOT: !fpmath !{{[0-9]+}}
   return a / b;
 }
 
@@ -17,7 +17,7 @@
   // CHECK: @spvectordiv
   // CHECK: fdiv{{.*}},
   // NODIVOPT: !fpmath ![[MD]]
-  // DIVOPT-NOT: !fpmath ![[MD]]
+  // DIVOPT-NOT: !fpmath !{{[0-9]+}}
   return a / b;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99857.335136.patch
Type: text/x-patch
Size: 590 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210404/0b3ae071/attachment.bin>


More information about the cfe-commits mailing list