summaryrefslogtreecommitdiffstats
path: root/llvm/test/Reduce/Inputs
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Reduce/Inputs')
-rwxr-xr-xllvm/test/Reduce/Inputs/remove-bbs.py1
-rwxr-xr-xllvm/test/Reduce/Inputs/remove-global-vars.py14
-rwxr-xr-xllvm/test/Reduce/Inputs/remove-instructions.py17
3 files changed, 28 insertions, 4 deletions
diff --git a/llvm/test/Reduce/Inputs/remove-bbs.py b/llvm/test/Reduce/Inputs/remove-bbs.py
index 099e8781396..71f099daaba 100755
--- a/llvm/test/Reduce/Inputs/remove-bbs.py
+++ b/llvm/test/Reduce/Inputs/remove-bbs.py
@@ -1,5 +1,4 @@
import sys
-import re
InterestingBBs = 0
input = open(sys.argv[1], "r")
diff --git a/llvm/test/Reduce/Inputs/remove-global-vars.py b/llvm/test/Reduce/Inputs/remove-global-vars.py
index 81fbea937dd..1ae8b0e6e76 100755
--- a/llvm/test/Reduce/Inputs/remove-global-vars.py
+++ b/llvm/test/Reduce/Inputs/remove-global-vars.py
@@ -2,9 +2,17 @@
import sys
+InterestingVar = 0
+
input = open(sys.argv[1], "r")
for line in input:
- if "@interesting = global" in line:
- sys.exit(0)
+ i = line.find(';')
+ if i >= 0:
+ line = line[:i]
+ if line.startswith("@interesting = global") or "@interesting" in line:
+ InterestingVar += 1
+
+if InterestingVar == 4:
+ sys.exit(0) # interesting!
-sys.exit(1) # IR isn't interesting
+sys.exit(1)
diff --git a/llvm/test/Reduce/Inputs/remove-instructions.py b/llvm/test/Reduce/Inputs/remove-instructions.py
new file mode 100755
index 00000000000..df4d85dd4f4
--- /dev/null
+++ b/llvm/test/Reduce/Inputs/remove-instructions.py
@@ -0,0 +1,17 @@
+import sys
+
+InterestingInstructions = 0
+
+input = open(sys.argv[1], "r")
+for line in input:
+ i = line.find(';')
+ if i >= 0:
+ line = line[:i]
+ if "%interesting" in line:
+ InterestingInstructions += 1
+ print InterestingInstructions
+
+if InterestingInstructions == 5:
+ sys.exit(0) # interesting!
+
+sys.exit(1)
OpenPOWER on IntegriCloud