Replace "CHECK-NOT: #{{.*}}" with same-line positive checks. NFC.
authorRyan Prichard <rprichard@google.com>
Fri, 6 Aug 2021 04:55:23 +0000 (21:55 -0700)
committerRyan Prichard <rprichard@google.com>
Fri, 6 Aug 2021 04:55:23 +0000 (21:55 -0700)
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.

Reviewed By: MaskRay

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

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

index a629c93..7cc23d3 100644 (file)
@@ -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
 }
index 80fb3ec..586ad6a 100644 (file)
@@ -364,14 +364,12 @@ declare i32 @fflush(%opaque*)
 ; 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 i64 @fwrite(i8*, i64, i64, %opaque*)
 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 @putc(i32, %opaque*)
 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]]