[PATCH] D99589: [test, InferFunctionAttrs] Fix use of var defined in CHECK-NOT
Thomas Preud'homme via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 30 11:01:56 PDT 2021
thopre updated this revision to Diff 334231.
thopre marked an inline comment as done.
thopre added a comment.
Move attribute check after the CHECK-NOT, test still passes
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99589/new/
https://reviews.llvm.org/D99589
Files:
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
@@ -1,12 +1,11 @@
-; RUN: opt < %s -mtriple=x86_64-- -inferattrs -S | FileCheck -check-prefix=CHECK-UNKNOWN %s
-; RUN: opt < %s -mtriple=x86_64-- -passes=inferattrs -S | FileCheck -check-prefix=CHECK-UNKNOWN %s
-; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -inferattrs -S | FileCheck -check-prefix=CHECK -check-prefix=CHECK-DARWIN %s
-; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -inferattrs -S | FileCheck -check-prefix=CHECK -check-prefix=CHECK-LINUX %s
-; RUN: opt < %s -mtriple=nvptx -inferattrs -S | FileCheck -check-prefix=CHECK-NVPTX %s
+; RUN: opt < %s -mtriple=x86_64-- -inferattrs -S | FileCheck --check-prefixes=CHECK,CHECK-UNKNOWN %s
+; RUN: opt < %s -mtriple=x86_64-- -passes=inferattrs -S | FileCheck --check-prefixes=CHECK,CHECK-UNKNOWN %s
+; RUN: opt < %s -mtriple=x86_64-apple-macosx10.8.0 -inferattrs -S | FileCheck --check-prefixes=CHECK,CHECK-KNOWN,CHECK-DARWIN %s
+; RUN: opt < %s -mtriple=x86_64-unknown-linux-gnu -inferattrs -S | FileCheck --check-prefixes=CHECK,CHECK-KNOWN,CHECK-LINUX %s
+; RUN: opt < %s -mtriple=nvptx -inferattrs -S | FileCheck --check-prefix=CHECK-NVPTX %s
declare i32 @__nvvm_reflect(i8*)
; CHECK-NVPTX: declare noundef i32 @__nvvm_reflect(i8* noundef) [[NOFREE_NOUNWIND_READNONE:#[0-9]+]]
-; CHECK-NVPTX: attributes [[NOFREE_NOUNWIND_READNONE]] = { nofree nounwind readnone }
; Check all the libc functions (thereby also exercising the prototype check).
@@ -241,7 +240,7 @@
; CHECK-LINUX: declare i32 @bcmp(i8* nocapture, i8* nocapture, i64) [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY:#[0-9]+]]
; CHECK-DARWIN-NOT: declare i32 @bcmp(i8* nocapture, i8* nocapture, i64) [[NOFREE_NOUNWIND_READONLY]]
; CHECK-UNKNOWN-NOT: declare i32 @bcmp(i8* nocapture, i8* nocapture, i64) [[NOFREE_NOUNWIND_READONLY]]
-; CHECK-NVPTX-NOT: declare i32 @bcmp(i8* nocapture, i8* nocapture, i64) [[NOFREE_NOUNWIND_READONLY]]
+; CHECK-NVPTX-NOT: declare i32 @bcmp(i8* nocapture, i8* nocapture, i64) #{{[0-9]+}}
declare i32 @bcmp(i8*, i8*, i64)
; CHECK: declare void @bcopy(i8* nocapture readonly, i8* nocapture writeonly, i64) [[ARGMEMONLY_NOFREE_NOUNWIND:#[0-9]+]]
@@ -367,10 +366,12 @@
; CHECK: declare i32 @ffs(i32) [[NOFREE_NOUNWIND_WILLRETURN]]
declare i32 @ffs(i32)
-; CHECK: declare i32 @ffsl(i64) [[NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK-KNOWN: declare i32 @ffsl(i64) [[NOFREE_NOUNWIND_WILLRETURN]]
+; CHECK-UNKNOWN: declare i32 @ffsl(i64)
declare i32 @ffsl(i64)
-; CHECK: declare i32 @ffsll(i64) [[NOFREE_NOUNWIND_WILLRETURN]]
+; 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]]
@@ -514,7 +515,8 @@
; CHECK: declare noundef i32 @getchar() [[NOFREE_NOUNWIND]]
declare i32 @getchar()
-; CHECK: declare noundef i32 @getchar_unlocked() [[NOFREE_NOUNWIND]]
+; CHECK-KNOWN: declare noundef i32 @getchar_unlocked() [[NOFREE_NOUNWIND]]
+; CHECK-UNKNOWN: declare i32 @getchar_unlocked()
declare i32 @getchar_unlocked()
; CHECK: declare noundef i8* @getenv(i8* nocapture noundef) [[NOFREE_NOUNWIND_READONLY]]
@@ -709,7 +711,8 @@
; CHECK: declare noundef i32 @putchar(i32 noundef) [[NOFREE_NOUNWIND]]
declare i32 @putchar(i32)
-; CHECK: declare noundef i32 @putchar_unlocked(i32 noundef) [[NOFREE_NOUNWIND]]
+; CHECK-KNOWN: declare noundef i32 @putchar_unlocked(i32 noundef) [[NOFREE_NOUNWIND]]
+; CHECK-UNKNOWN: declare i32 @putchar_unlocked(i32)
declare i32 @putchar_unlocked(i32)
; CHECK: declare noundef i32 @puts(i8* nocapture noundef readonly) [[NOFREE_NOUNWIND]]
@@ -1039,3 +1042,4 @@
; CHECK-DAG-LINUX: attributes [[WILLRETURN]]= { willreturn }
; CHECK-DAG-LINUX: attributes [[INACCESSIBLEMEMORARGONLY_NOFREE_NOUNWIND_WILLRETURN]] = { inaccessiblemem_or_argmemonly nofree nounwind willreturn }
; CHECK-DAG-LINUX: attributes [[ARGMEMONLY_NOFREE_NOUNWIND]] = { inaccessiblememonly nofree nounwind }
+; CHECK-NVPTX: attributes [[NOFREE_NOUNWIND_READNONE]] = { nofree nounwind readnone }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99589.334231.patch
Type: text/x-patch
Size: 4274 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210330/85139d4f/attachment.bin>
More information about the llvm-commits
mailing list