summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/UpdateTestChecks
diff options
context:
space:
mode:
authorJohannes Doerfert <johannes@jdoerfert.de>2019-10-10 20:32:04 -0500
committerJohannes Doerfert <johannes@jdoerfert.de>2019-12-31 01:51:22 -0600
commit70771d8b9e8dba857bce39eee8f5d10ecc17d00f (patch)
tree7ead3514d79ba7095335dca738f4707a4e789f09 /llvm/test/tools/UpdateTestChecks
parentdada8132af65c1fa74070839c260cd78d97a0903 (diff)
downloadbcm5719-llvm-70771d8b9e8dba857bce39eee8f5d10ecc17d00f.tar.gz
bcm5719-llvm-70771d8b9e8dba857bce39eee8f5d10ecc17d00f.zip
[Utils] Allow update_test_checks to scrub attribute annotations
Attribute annotations on calls, e.g., #0, are not useful on their own. This patch adds a flag to update_test_checks.py to scrub them. Reviewed By: lebedev.ri Differential Revision: https://reviews.llvm.org/D68851
Diffstat (limited to 'llvm/test/tools/UpdateTestChecks')
-rw-r--r--llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/scrub_attrs.ll8
-rw-r--r--llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/scrub_attrs.ll.plain.expected13
-rw-r--r--llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/scrub_attrs.ll.scrub.expected13
-rw-r--r--llvm/test/tools/UpdateTestChecks/update_test_checks/scrub_attrs.test9
4 files changed, 43 insertions, 0 deletions
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/scrub_attrs.ll b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/scrub_attrs.ll
new file mode 100644
index 00000000000..2733cfbce82
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/scrub_attrs.ll
@@ -0,0 +1,8 @@
+; RUN: opt -S < %s | FileCheck %s
+
+declare void @foo()
+
+define internal void @bar() {
+ call void @foo() readnone
+ ret void
+}
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/scrub_attrs.ll.plain.expected b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/scrub_attrs.ll.plain.expected
new file mode 100644
index 00000000000..525e57432fb
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/scrub_attrs.ll.plain.expected
@@ -0,0 +1,13 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S < %s | FileCheck %s
+
+declare void @foo()
+
+define internal void @bar() {
+; CHECK-LABEL: @bar(
+; CHECK-NEXT: call void @foo() #0
+; CHECK-NEXT: ret void
+;
+ call void @foo() readnone
+ ret void
+}
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/scrub_attrs.ll.scrub.expected b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/scrub_attrs.ll.scrub.expected
new file mode 100644
index 00000000000..cbea04a0971
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/scrub_attrs.ll.scrub.expected
@@ -0,0 +1,13 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S < %s | FileCheck %s
+
+declare void @foo()
+
+define internal void @bar() {
+; CHECK-LABEL: @bar(
+; CHECK-NEXT: call void @foo()
+; CHECK-NEXT: ret void
+;
+ call void @foo() readnone
+ ret void
+}
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/scrub_attrs.test b/llvm/test/tools/UpdateTestChecks/update_test_checks/scrub_attrs.test
new file mode 100644
index 00000000000..0adfb8440b3
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/scrub_attrs.test
@@ -0,0 +1,9 @@
+## scrub_attrs test checking that update_test_checks.py works correctly
+# RUN: cp -f %S/Inputs/scrub_attrs.ll %t.ll && %update_test_checks %t.ll
+# RUN: diff -u %t.ll %S/Inputs/scrub_attrs.ll.plain.expected
+## Check that running the script again does not change the result:
+# RUN: %update_test_checks %t.ll
+# RUN: diff -u %t.ll %S/Inputs/scrub_attrs.ll.plain.expected
+## Also try the --scrub-attributes flag
+# RUN: %update_test_checks %t.ll --scrub-attributes
+# RUN: diff -u %t.ll %S/Inputs/scrub_attrs.ll.scrub.expected
OpenPOWER on IntegriCloud