aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-12-16 20:09:54 +0000
committerChris Lattner <sabre@nondot.org>2002-12-16 20:09:54 +0000
commit1ada06480392243f7c7986434f98e63eeecb216f (patch)
tree16d47f59e797cec55f00f082b4da53299089ab37
parent8a307e8c63f9df4461c2f6d1b1d57fd6642a26af (diff)
New testcase for printing out arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5085 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/ExecutionEngine/2002-12-16-ArgTest.ll44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/ExecutionEngine/2002-12-16-ArgTest.ll b/test/ExecutionEngine/2002-12-16-ArgTest.ll
new file mode 100644
index 0000000000..077e45abab
--- /dev/null
+++ b/test/ExecutionEngine/2002-12-16-ArgTest.ll
@@ -0,0 +1,44 @@
+%.LC0 = internal global [14 x sbyte] c"in getoptions\00" ; <[14 x sbyte]*> [#uses=1]
+
+implementation ; Functions:
+
+declare void %__main()
+
+declare int %puts(sbyte*)
+
+void %getoptions(int* %argc) {
+bb0: ; No predecessors!
+ ret void
+}
+
+int %main(int %argc, sbyte** %argv) {
+bb0: ; No predecessors!
+ %cast224 = cast sbyte** %argv to sbyte* ; <sbyte*> [#uses=1]
+ %local = alloca sbyte* ; <sbyte**> [#uses=3]
+ store sbyte* %cast224, sbyte** %local
+ call void %__main( )
+ %cond226 = setle int %argc, 0 ; <bool> [#uses=1]
+ br bool %cond226, label %bb3, label %bb2
+
+bb2: ; preds = %bb2, %bb0
+ %cann-indvar = phi int [ 0, %bb0 ], [ %add1-indvar, %bb2 ] ; <int> [#uses=2]
+ %add1-indvar = add int %cann-indvar, 1 ; <int> [#uses=2]
+ %cann-indvar-idxcast = cast int %cann-indvar to long ; <long> [#uses=1]
+ ;%reg115 = load sbyte** %local ; <sbyte*> [#uses=1]
+ ;%cann-indvar-idxcast-scale = mul long %cann-indvar-idxcast, 8 ; <long> [#uses=1]
+ ;%reg232 = getelementptr sbyte* %reg115, long %cann-indvar-idxcast-scale ; <sbyte*> [#uses=1]
+ ;%cast235 = cast sbyte* %reg232 to sbyte** ; <sbyte**> [#uses=1]
+ %CT = cast sbyte** %local to sbyte***
+ %reg115 = load sbyte*** %CT
+ %cast235 = getelementptr sbyte** %reg115, long %cann-indvar-idxcast
+
+ %reg117 = load sbyte** %cast235 ; <sbyte*> [#uses=1]
+ %reg236 = call int %puts( sbyte* %reg117 ) ; <int> [#uses=0]
+ %cond239 = setlt int %add1-indvar, %argc ; <bool> [#uses=1]
+ br bool %cond239, label %bb2, label %bb3
+
+bb3: ; preds = %bb2, %bb0
+ %cast243 = cast sbyte** %local to int* ; <int*> [#uses=1]
+ call void %getoptions( int* %cast243 )
+ ret int 0
+}