[PATCH] D107614: Replace "CHECK-NOT: #{{.*}}" with same-line positive checks. NFC.

Ryan Prichard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 5 17:22:18 PDT 2021


rprichard created this revision.
rprichard requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The intent of the negative #{{.*}} checks is to verify that the line
declaring/defining a function has no attribute, but they could restrict
later function declarations instead.

The 2008-09-02-FunctionNotes.ll check had allowed @fn3 to have an
attribute, because there is only a single "define void @fn3()" in the
output.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107614

Files:
  llvm/test/Assembler/2008-09-02-FunctionNotes.ll
  llvm/test/Transforms/InferFunctionAttrs/annotate.ll


Index: llvm/test/Transforms/InferFunctionAttrs/annotate.ll
===================================================================
--- llvm/test/Transforms/InferFunctionAttrs/annotate.ll
+++ llvm/test/Transforms/InferFunctionAttrs/annotate.ll
@@ -364,14 +364,12 @@
 ; CHECK: declare i32 @ffs(i32) [[NOFREE_NOUNWIND_WILLRETURN]]
 declare i32 @ffs(i32)
 
-; CHECK: declare i32 @ffsl(i64)
-; CHECK-KNOWN-SAME: [[NOFREE_NOUNWIND_WILLRETURN]]
-; CHECK-UNKNOWN-NOT: #{{.*}}
+; CHECK-KNOWN: declare i32 @ffsl(i64) [[NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK-UNKNOWN: declare i32 @ffsl(i64){{$}}
 declare i32 @ffsl(i64)
 
-; CHECK: declare i32 @ffsll(i64)
-; CHECK-KNOWN-SAME: [[NOFREE_NOUNWIND_WILLRETURN]]
-; CHECK-UNKNOWN-NOT: #{{.*}}
+; CHECK-KNOWN: declare i32 @ffsll(i64) [[NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK-UNKNOWN: declare i32 @ffsll(i64){{$}}
 declare i32 @ffsll(i64)
 
 ; CHECK: declare noundef i32 @fgetc(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
@@ -510,16 +508,14 @@
 declare i32 @getc(%opaque*)
 
 ; CHECK-KNOWN: declare noundef i32 @getc_unlocked(%opaque* nocapture noundef) [[NOFREE_NOUNWIND]]
-; CHECK-UNKNOWN: declare i32 @getc_unlocked(%opaque*)
-; CHECK-UNKNOWN-NOT: #{{.*}}
+; CHECK-UNKNOWN: declare i32 @getc_unlocked(%opaque*){{$}}
 declare i32 @getc_unlocked(%opaque*)
 
 ; CHECK: declare noundef i32 @getchar() [[NOFREE_NOUNWIND]]
 declare i32 @getchar()
 
 ; CHECK-KNOWN: declare noundef i32 @getchar_unlocked() [[NOFREE_NOUNWIND]]
-; CHECK-UNKNOWN: declare i32 @getchar_unlocked()
-; CHECK-UNKNOWN-NOT: #{{.*}}
+; CHECK-UNKNOWN: declare i32 @getchar_unlocked(){{$}}
 declare i32 @getchar_unlocked()
 
 ; CHECK: declare noundef i8* @getenv(i8* nocapture noundef) [[NOFREE_NOUNWIND_READONLY]]
@@ -714,8 +710,7 @@
 declare i32 @putchar(i32)
 
 ; CHECK-KNOWN: declare noundef i32 @putchar_unlocked(i32 noundef) [[NOFREE_NOUNWIND]]
-; CHECK-UNKNOWN: declare i32 @putchar_unlocked(i32)
-; CHECK-UNKNOWN-NOT: #{{.*}}
+; CHECK-UNKNOWN: declare i32 @putchar_unlocked(i32){{$}}
 declare i32 @putchar_unlocked(i32)
 
 ; CHECK: declare noundef i32 @puts(i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
Index: llvm/test/Assembler/2008-09-02-FunctionNotes.ll
===================================================================
--- llvm/test/Assembler/2008-09-02-FunctionNotes.ll
+++ llvm/test/Assembler/2008-09-02-FunctionNotes.ll
@@ -2,18 +2,17 @@
 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s
 ; RUN: verify-uselistorder %s
 
-; CHECK: define void @fn1() #0
+; CHECK: define void @fn1() #0 {
 define void @fn1() alwaysinline {
   ret void
 }
 
-; CHECK: define void @fn2() #1
+; CHECK: define void @fn2() #1 {
 define void @fn2() noinline {
   ret void
 }
 
-; CHECK: define void @fn3()
-; CHECK-NOT: define void @fn3() #{{.*}}
+; CHECK: define void @fn3() {
 define void @fn3() {
   ret void
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107614.364658.patch
Type: text/x-patch
Size: 2810 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210806/ef44edec/attachment.bin>


More information about the llvm-commits mailing list