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

Ryan Prichard via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 5 21:55:38 PDT 2021


Author: Ryan Prichard
Date: 2021-08-05T21:55:23-07:00
New Revision: daab81cda18a1e33aa8973ee34589960b4382f25

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

LOG: Replace "CHECK-NOT: #{{.*}}" with same-line positive checks. NFC.

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/test/Assembler/2008-09-02-FunctionNotes.ll b/llvm/test/Assembler/2008-09-02-FunctionNotes.ll
index a629c9341a9f0..7cc23d3821bbf 100644
--- a/llvm/test/Assembler/2008-09-02-FunctionNotes.ll
+++ b/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
 }

diff  --git a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
index 80fb3ecf1bd6b..586ad6a99cede 100644
--- a/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
+++ b/llvm/test/Transforms/InferFunctionAttrs/annotate.ll
@@ -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]]


        


More information about the llvm-commits mailing list