aboutsummaryrefslogtreecommitdiffstats
path: root/test/BugPoint
diff options
context:
space:
mode:
Diffstat (limited to 'test/BugPoint')
-rw-r--r--test/BugPoint/crash-narrowfunctiontest.ll12
-rw-r--r--test/BugPoint/dg.exp3
-rw-r--r--test/BugPoint/misopt-basictest.ll14
-rw-r--r--test/BugPoint/remove_arguments_test.ll11
4 files changed, 40 insertions, 0 deletions
diff --git a/test/BugPoint/crash-narrowfunctiontest.ll b/test/BugPoint/crash-narrowfunctiontest.ll
new file mode 100644
index 0000000..ef0db8d
--- /dev/null
+++ b/test/BugPoint/crash-narrowfunctiontest.ll
@@ -0,0 +1,12 @@
+; Test that bugpoint can narrow down the testcase to the important function
+;
+; RUN: bugpoint %s -bugpoint-crashcalls
+
+define i32 @foo() { ret i32 1 }
+
+define i32 @test() {
+ call i32 @test()
+ ret i32 %1
+}
+
+define i32 @bar() { ret i32 2 }
diff --git a/test/BugPoint/dg.exp b/test/BugPoint/dg.exp
new file mode 100644
index 0000000..de42dad
--- /dev/null
+++ b/test/BugPoint/dg.exp
@@ -0,0 +1,3 @@
+load_lib llvm.exp
+
+RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.ll]]
diff --git a/test/BugPoint/misopt-basictest.ll b/test/BugPoint/misopt-basictest.ll
new file mode 100644
index 0000000..66cc53f
--- /dev/null
+++ b/test/BugPoint/misopt-basictest.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-upgrade < %s > %t1.ll
+; RUN: bugpoint %t1.ll -dce -bugpoint-deletecalls -simplifycfg
+
+%.LC0 = internal global [13 x sbyte] c"Hello World\0A\00"
+
+implementation
+
+declare int %printf(sbyte*, ...)
+
+int %main() {
+ call int(sbyte*, ...)* %printf( sbyte* getelementptr ([13 x sbyte]* %.LC0, long 0, long 0) )
+ ret int 0
+}
+
diff --git a/test/BugPoint/remove_arguments_test.ll b/test/BugPoint/remove_arguments_test.ll
new file mode 100644
index 0000000..4d2c60d
--- /dev/null
+++ b/test/BugPoint/remove_arguments_test.ll
@@ -0,0 +1,11 @@
+; RUN: bugpoint %s -bugpoint-crashcalls
+
+; Test to make sure that arguments are removed from the function if they are
+; unnecessary.
+
+declare i32 @test2()
+
+define i32 @test(i32 %A, i32 %B, float %C) {
+ call i32 @test2()
+ ret i32 %1
+}