llvm.org GIT mirror llvm / 6b7c89e
stop accepting begin/end around function bodies in the .ll parser, this isn't pascal anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133244 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 8 years ago
27 changed file(s) with 7 addition(s) and 678 deletion(s). Raw diff Collapse all Expand all
470470 if (Len == strlen(#STR) && !memcmp(StartChar, #STR, strlen(#STR))) \
471471 return lltok::kw_##STR;
472472
473 KEYWORD(begin); KEYWORD(end);
474473 KEYWORD(true); KEYWORD(false);
475474 KEYWORD(declare); KEYWORD(define);
476475 KEYWORD(global); KEYWORD(constant);
28342834
28352835 /// ParseFunctionBody
28362836 /// ::= '{' BasicBlock+ '}'
2837 /// ::= 'begin' BasicBlock+ 'end' // FIXME: remove in LLVM 3.0
28382837 ///
28392838 bool LLParser::ParseFunctionBody(Function &Fn) {
2840 if (Lex.getKind() != lltok::lbrace && Lex.getKind() != lltok::kw_begin)
2839 if (Lex.getKind() != lltok::lbrace)
28412840 return TokError("expected '{' in function body");
28422841 Lex.Lex(); // eat the {.
28432842
28472846 PerFunctionState PFS(*this, Fn, FunctionNumber);
28482847
28492848 // We need at least one basic block.
2850 if (Lex.getKind() == lltok::rbrace || Lex.getKind() == lltok::kw_end)
2849 if (Lex.getKind() == lltok::rbrace)
28512850 return TokError("function body requires at least one basic block");
28522851
2853 while (Lex.getKind() != lltok::rbrace && Lex.getKind() != lltok::kw_end)
2852 while (Lex.getKind() != lltok::rbrace)
28542853 if (ParseBasicBlock(PFS)) return true;
28552854
28562855 // Eat the }.
3131 exclaim, // !
3232
3333 kw_x,
34 kw_begin, kw_end,
3534 kw_true, kw_false,
3635 kw_declare, kw_define,
3736 kw_global, kw_constant,
+0
-25
test/Integer/BitArith.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5 declare void @"foo"(i31 %i, i63 %j, i10 %k)
6
7
8 ; foo test basic arith operations
9 define void @"foo"(i31 %i, i63 %j, i10 %k)
10 begin
11 %t1 = trunc i63 %j to i31
12 %t2 = add i31 %t1, %i
13 %t20 = add i31 3, %t1
14 %t3 = zext i31 %i to i63
15 %t4 = sub i63 %t3, %j
16 %t40 = sub i63 %j, -100
17 %t5 = mul i10 %k, 7
18 %t6 = sdiv i63 %j, -2
19 %t7 = udiv i63 %j, %t3
20 %t8 = urem i10 %k, 10
21 %t9 = srem i10 %k, -10
22 ret void
23 end
24
+0
-24
test/Integer/BitBit.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4 declare void @"foo"(i31 %i, i33 %j)
5
6
7 ; foo test basic bitwise operations
8 define void @"foo"(i31 %i, i33 %j)
9 begin
10 %t1 = trunc i33 %j to i31
11 %t2 = and i31 %t1, %i
12 %t3 = sext i31 %i to i33
13 %t4 = or i33 %t3, %j
14 %t5 = xor i31 %t2, 7
15 %t6 = shl i31 %i, 2
16 %t7 = trunc i31 %i to i8
17 %t8 = shl i8 %t7, 3
18 %t9 = lshr i33 %j, 31
19 %t7z = zext i8 %t7 to i33
20 %t10 = ashr i33 %j, %t7z
21 ret void
22 end
23
+0
-26
test/Integer/BitCast.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4 declare void @"foo"(i31 %i, i1280 %j, i1 %k, float %f)
5
6
7 ; foo test basic arith operations
8 define void @"foo"(i31 %i, i1280 %j, i1 %k, float %f)
9 begin
10 %t1 = trunc i1280 %j to i31
11 %t2 = trunc i31 %t1 to i1
12
13 %t3 = zext i31 %i to i1280
14 %t4 = sext i31 %i to i1280
15
16 %t5 = fptoui float 0x400921FA00000000 to i31
17 %t6 = uitofp i31 %t5 to double
18
19 %t7 = fptosi double 0xC0934A456D5CFAAD to i28
20 %t8 = sitofp i8 -1 to double
21 %t9 = uitofp i8 255 to double
22
23 ret void
24 end
25
+0
-43
test/Integer/BitIcmp.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5 define i55 @"simpleIcmp"(i55 %i0, i55 %j0)
6 begin
7 %t1 = icmp eq i55 %i0, %j0
8 %t2 = icmp ne i55 %i0, %j0
9 %t3 = icmp ult i55 %i0, %j0
10 %t4 = icmp sgt i55 %i0, %j0
11 %t5 = icmp ule i55 %i0, %j0
12 %t6 = icmp sge i55 %i0, %j0
13
14 %t7 = icmp eq i55 %i0, 1098765432
15 %t8 = icmp ne i55 %i0, -31415926
16
17 %t9 = icmp ult i55 10000, %j0
18 %t10 = icmp sgt i55 -10000, %j0
19
20 ret i55 %i0
21 end
22
23 define i31 @"phitest"(i12 %i)
24 begin
25
26 HasArg:
27 %n1 = add i12 1, %i
28 br label %Continue
29
30 Continue:
31 %n = phi i12 [%n1, %HasArg], [%next, %Continue]
32 %next = add i12 1, %n
33 br label %Continue
34 end
35
36 define i18 @"select"(i18 %i)
37 begin
38 %t = icmp sgt i18 %i, 100
39 %k = select i1 %t, i18 %i, i18 999
40 ret i18 %k
41 end
42
+0
-24
test/Integer/BitMisc.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5 @MyVar = external global i19
6 @MyIntList = external global { i39 *, i19 }
7 external global i19 ; i19*:0
8
9 @AConst = constant i19 -123
10
11 @AString = constant [4 x i8] c"test"
12
13 @ZeroInit = global { [100 x i19 ], [40 x float ] } { [100 x i19] zeroinitializer,
14 [40 x float] zeroinitializer }
15
16
17 define i19 @"foo"(i19 %blah)
18 begin
19 store i19 5, i19* @MyVar
20 %idx = getelementptr { i39 *, i19 } * @MyIntList, i64 0, i32 1
21 store i19 12, i19* %idx
22 ret i19 %blah
23 end
+0
-56
test/Integer/cfgstructures_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5 ;; This is an irreducible flow graph
6
7
8 define void @"irreducible"(i1 %cond)
9 begin
10 br i1 %cond, label %X, label %Y
11
12 X:
13 br label %Y
14 Y:
15 br label %X
16 end
17
18 ;; This is a pair of loops that share the same header
19
20 define void @"sharedheader"(i1 %cond)
21 begin
22 br label %A
23 A:
24 br i1 %cond, label %X, label %Y
25
26 X:
27 br label %A
28 Y:
29 br label %A
30 end
31
32 ;; This is a simple nested loop
33 define void @"nested"(i1 %cond1, i1 %cond2, i1 %cond3)
34 begin
35 br label %Loop1
36
37 Loop1:
38 br label %Loop2
39
40 Loop2:
41 br label %Loop3
42
43 Loop3:
44 br i1 %cond3, label %Loop3, label %L3Exit
45
46 L3Exit:
47 br i1 %cond2, label %Loop2, label %L2Exit
48
49 L2Exit:
50 br i1 %cond1, label %Loop1, label %L1Exit
51
52 L1Exit:
53 ret void
54 end
55
+0
-33
test/Integer/forwardreftest_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4 %myty = type i55
5 %myfn = type float (i55,double,i55,i16)
6 type i55(%myfn*)
7 type i55(i55)
8 type i55(i55(i55)*)
9
10 %thisfuncty = type i55 (i55) *
11
12 declare void @F(%thisfuncty, %thisfuncty, %thisfuncty)
13
14 ; This function always returns zero
15 define i55 @zarro(i55 %Func)
16 begin
17 Startup:
18 add i55 0, 10
19 ret i55 0
20 end
21
22 define i55 @test(i55)
23 begin
24 call void @F(%thisfuncty @zarro, %thisfuncty @test, %thisfuncty @foozball)
25 ret i55 0
26 end
27
28 define i55 @foozball(i55)
29 begin
30 ret i55 0
31 end
32
+0
-26
test/Integer/globalvars_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5
6 @MyVar = external global i27
7 @MyIntList = external global { \2 *, i27 }
8 external global i27 ; i27*:0
9
10 @AConst = constant i27 123
11
12 @AString = constant [4 x i8] c"test"
13
14 @ZeroInit = global { [100 x i27 ], [40 x float ] } { [100 x i27] zeroinitializer,
15 [40 x float] zeroinitializer }
16
17
18 define i27 @"foo"(i27 %blah)
19 begin
20 store i27 5, i27 *@MyVar
21 %idx = getelementptr { \2 *, i27 } * @MyIntList, i64 0, i32 1
22 store i27 12, i27* %idx
23 ret i27 %blah
24 end
25
+0
-24
test/Integer/indirectcall2_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5 define i63 @"test"(i63 %X)
6 begin
7 ret i63 %X
8 end
9
10 define i63 @"fib"(i63 %n)
11 begin
12 %T = icmp ult i63 %n, 2 ; {i1}:0
13 br i1 %T, label %BaseCase, label %RecurseCase
14
15 RecurseCase:
16 %result = call i63 @test(i63 %n)
17 br label %BaseCase
18
19 BaseCase:
20 %X = phi i63 [1, %0], [2, %RecurseCase]
21 ret i63 %X
22 end
23
+0
-52
test/Integer/indirectcall_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5 declare i32 @"atoi"(i8 *)
6
7 define i63 @"fib"(i63 %n)
8 begin
9 icmp ult i63 %n, 2 ; {i1}:1
10 br i1 %1, label %BaseCase, label %RecurseCase
11
12 BaseCase:
13 ret i63 1
14
15 RecurseCase:
16 %n2 = sub i63 %n, 2
17 %n1 = sub i63 %n, 1
18 %f2 = call i63(i63) * @fib(i63 %n2)
19 %f1 = call i63(i63) * @fib(i63 %n1)
20 %result = add i63 %f2, %f1
21 ret i63 %result
22 end
23
24 define i63 @"realmain"(i32 %argc, i8 ** %argv)
25 begin
26 icmp eq i32 %argc, 2 ; {i1}:1
27 br i1 %1, label %HasArg, label %Continue
28 HasArg:
29 ; %n1 = atoi(argv[1])
30 %n1 = add i32 1, 1
31 br label %Continue
32
33 Continue:
34 %n = phi i32 [%n1, %HasArg], [1, %0]
35 %N = sext i32 %n to i63
36 %F = call i63(i63) *@fib(i63 %N)
37 ret i63 %F
38 end
39
40 define i63 @"trampoline"(i63 %n, i63(i63)* %fibfunc)
41 begin
42 %F = call i63(i63) *%fibfunc(i63 %n)
43 ret i63 %F
44 end
45
46 define i32 @"main"()
47 begin
48 %Result = call i63 @trampoline(i63 10, i63(i63) *@fib)
49 %Result2 = trunc i63 %Result to i32
50 ret i32 %Result2
51 end
+0
-13
test/Integer/prototype_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5 declare i31 @"bar"(i31 %in)
6
7 define i31 @"foo"(i31 %blah)
8 begin
9 %xx = call i31 @bar(i31 %blah)
10 ret i31 %xx
11 end
12
+0
-108
test/Integer/recursivetype_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5 ; This file contains the output from the following compiled C code:
6 ; typedef struct list {
7 ; struct list *Next;
8 ; i32 Data;
9 ; } list;
10 ;
11 ; // Iterative insert fn
12 ; void InsertIntoListTail(list **L, i32 Data) {
13 ; while (*L)
14 ; L = &(*L)->Next;
15 ; *L = (list*)malloc(sizeof(list));
16 ; (*L)->Data = Data;
17 ; (*L)->Next = 0;
18 ; }
19 ;
20 ; // Recursive list search fn
21 ; list *FindData(list *L, i32 Data) {
22 ; if (L == 0) return 0;
23 ; if (L->Data == Data) return L;
24 ; return FindData(L->Next, Data);
25 ; }
26 ;
27 ; void DoListStuff() {
28 ; list *MyList = 0;
29 ; InsertIntoListTail(&MyList, 100);
30 ; InsertIntoListTail(&MyList, 12);
31 ; InsertIntoListTail(&MyList, 42);
32 ; InsertIntoListTail(&MyList, 1123);
33 ; InsertIntoListTail(&MyList, 1213);
34 ;
35 ; if (FindData(MyList, 75)) foundIt();
36 ; if (FindData(MyList, 42)) foundIt();
37 ; if (FindData(MyList, 700)) foundIt();
38 ; }
39
40 %list = type { %list*, i36 }
41
42 declare i8 *@"malloc"(i32)
43
44 ;;**********************
45 ;;**********************
46
47 define void @"InsertIntoListTail"(%list** %L, i36 %Data)
48 begin
49 bb1:
50 %reg116 = load %list** %L ;;<%list*>
51 %cast1004 = inttoptr i64 0 to %list* ;;<%list*>
52 %cond1000 = icmp eq %list* %reg116, %cast1004 ;;
53 br i1 %cond1000, label %bb3, label %bb2
54
55 bb2:
56 %reg117 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ;;<%list**>
57 %cast1010 = bitcast %list** %reg117 to %list*** ;;<%list***>
58 %reg118 = load %list*** %cast1010 ;;<%list**>
59 %reg109 = load %list** %reg118 ;;<%list*>
60 %cast1005 = inttoptr i64 0 to %list* ;;<%list*>
61 %cond1001 = icmp ne %list* %reg109, %cast1005 ;;
62 br i1 %cond1001, label %bb2, label %bb3
63
64 bb3:
65 %reg119 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ;;<%list**>
66 %cast1006 = bitcast %list** %reg119 to i8** ;;
67 %reg111 = call i8* @malloc(i32 16) ;;
68 store i8* %reg111, i8** %cast1006 ;;
69 %reg112 = ptrtoint i8* %reg111 to i64
70 %reg1002 = add i64 %reg112, 8
71 %reg1005 = inttoptr i64 %reg1002 to i8* ;;
72 %cast1008 = bitcast i8* %reg1005 to i36* ;;
73 store i36 %Data, i36* %cast1008 ;;
74 %cast1003 = inttoptr i64 0 to i64* ;;
75 %cast1009 = bitcast i8* %reg111 to i64** ;;
76 store i64* %cast1003, i64** %cast1009 ;;
77 ret void
78 end
79
80 define %list* @"FindData"(%list* %L, i36 %Data)
81 begin
82 bb1:
83 br label %bb2
84
85 bb2:
86 %reg115 = phi %list* [ %reg116, %bb6 ], [ %L, %bb1 ] ;;<%list*>
87 %cast1014 = inttoptr i64 0 to %list* ;;<%list*>
88 %cond1011 = icmp ne %list* %reg115, %cast1014 ;;
89 br i1 %cond1011, label %bb4, label %bb3
90
91 bb3:
92 ret %list* null
93
94 bb4:
95 %idx = getelementptr %list* %reg115, i64 0, i32 1 ;;
96 %reg111 = load i36* %idx
97 %cond1013 = icmp ne i36 %reg111, %Data ;;
98 br i1 %cond1013, label %bb6, label %bb5
99
100 bb5:
101 ret %list* %reg115
102
103 bb6:
104 %idx2 = getelementptr %list* %reg115, i64 0, i32 0 ;;<%list*>
105 %reg116 = load %list** %idx2
106 br label %bb2
107 end
+0
-28
test/Integer/simplecalltest_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4 %FunTy = type i31(i31)
5
6
7 define void @"invoke"(%FunTy *%x)
8 begin
9 %foo = call %FunTy* %x(i31 123)
10 ret void
11 end
12
13 define i31 @"main"(i31 %argc, i8 **%argv, i8 **%envp)
14 begin
15 %retval = call i31 (i31) *@test(i31 %argc)
16 %two = add i31 %retval, %retval
17 %retval2 = call i31 @test(i31 %argc)
18
19 %two2 = add i31 %two, %retval2
20 call void @invoke (%FunTy* @test)
21 ret i31 %two2
22 end
23
24 define i31 @"test"(i31 %i0)
25 begin
26 ret i31 %i0
27 end
+0
-13
test/Integer/small_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4 %x = type i19
5
6
7 define i19 @"foo"(i19 %in)
8 begin
9 label:
10 ret i19 2
11 end
12
+0
-28
test/Integer/testalloca_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5 %inners = type {float, {i8 } }
6 %struct = type { i33 , {float, {i8 } } , i64 }
7
8
9 define i33 @testfunction(i33 %i0, i33 %j0)
10 begin
11 alloca i8, i32 5
12 %ptr = alloca i33 ; yields {i33*}:ptr
13 store i33 3, i33* %ptr ; yields {void}
14 %val = load i33* %ptr ; yields {i33}:val = i33 %3
15
16 %sptr = alloca %struct ; yields {%struct*}:sptr
17 %nsptr = getelementptr %struct * %sptr, i64 0, i32 1 ; yields {inners*}:nsptr
18 %ubsptr = getelementptr %inners * %nsptr, i64 0, i32 1 ; yields {{i8}*}:ubsptr
19 %idx = getelementptr {i8} * %ubsptr, i64 0, i32 0
20 store i8 4, i8* %idx
21
22 %fptr = getelementptr %struct * %sptr, i64 0, i32 1, i32 0 ; yields {float*}:fptr
23 store float 4.0, float * %fptr
24
25 ret i33 3
26 end
27
+0
-21
test/Integer/testarith_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5 define i31 @"simpleArith"(i31 %i0, i31 %j0)
6 begin
7 %t1 = add i31 %i0, %j0
8 %t2 = sub i31 %i0, %j0
9 %t3 = mul i31 %t1, %t2
10 %t4 = udiv i31 %t1, %t2
11 %t5 = sdiv i31 %t1, %t2
12 %t6 = urem i31 %t1, %t2
13 %t7 = srem i31 %t1, %t2
14 %t8 = shl i31 %t1, 9
15 %t9 = lshr i31 %t1, 9
16 %t10= ashr i31 %t1, 9
17 %f1 = sitofp i31 %t1 to float
18 %f2 = fdiv float 4.0, %f1
19 ret i31 %t3
20 end
+0
-32
test/Integer/testconstants_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4 @somestr = constant [11x i8] c"hello world"
5 @array = constant [2 x i55] [ i55 12, i55 52 ]
6 constant { i55, i55 } { i55 4, i55 3 }
7
8
9 define [2 x i55]* @testfunction(i55 %i0, i55 %j0)
10 begin
11 ret [2x i55]* @array
12 end
13
14 define i8* @otherfunc(i55, double)
15 begin
16 %somestr = getelementptr [11x i8]* @somestr, i64 0, i64 0
17 ret i8* %somestr
18 end
19
20 define i8* @yetanotherfunc(i55, double)
21 begin
22 ret i8* null ; Test null
23 end
24
25 define i55 @negativeUnsigned() {
26 ret i55 -1
27 }
28
29 define i55 @largeSigned() {
30 ret i55 3900000000
31 }
+0
-23
test/Integer/testicmp_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5 define i31 @"simpleIcmp"(i31 %i0, i31 %j0)
6 begin
7 %t1 = icmp eq i31 %i0, %j0
8 %t2 = icmp ne i31 %i0, %j0
9 %t3 = icmp ult i31 %i0, %j0
10 %t4 = icmp sgt i31 %i0, %j0
11 %t5 = icmp ule i31 %i0, %j0
12 %t6 = icmp sge i31 %i0, %j0
13
14 %t7 = icmp eq i31 %i0, 1098765432
15 %t8 = icmp ne i31 %i0, -31415926
16
17 %t9 = icmp ult i31 10000, %j0
18 %t10 = icmp sgt i31 -10000, %j0
19
20
21 ret i31 %i0
22 end
+0
-13
test/Integer/testlogical_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5 define i31 @"simpleAdd"(i31 %i0, i31 %j0)
6 begin
7 %t1 = xor i31 %i0, %j0
8 %t2 = or i31 %i0, %j0
9 %t3 = and i31 %t1, %t2
10 ret i31 %t3
11 end
12
+0
-15
test/Integer/testlogical_new_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5 define i31 @"simpleAdd"(i31 %i0, i31 %j0)
6 begin
7 %t1 = xor i31 %i0, %j0
8 %t2 = or i31 %i0, %j0
9 %t3 = and i31 %t1, %t2
10 %t4 = shl i31 %i0, 2
11 %t5 = ashr i31 %i0, 2
12 %t6 = lshr i31 %j0, 22
13 ret i31 %t3
14 end
+0
-24
test/Integer/testswitch_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4 %i35 = type i35
5
6
7 define i35 @"squared"(%i35 %i0)
8 begin
9 switch i35 %i0, label %Default [
10 i35 1, label %Case1
11 i35 2, label %Case2
12 i35 4, label %Case4 ]
13
14 Default:
15 ret i35 -1 ; Unrecognized input value
16
17 Case1:
18 ret i35 1
19 Case2:
20 ret i35 4
21 Case4:
22 ret i35 16
23 end
+0
-14
test/Integer/testvarargs_bt.ll less more
None ; RUN: llvm-as %s -o - | llvm-dis > %t1.ll
1 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
2 ; RUN: diff %t1.ll %t2.ll
3
4
5 declare i31 @"printf"(i8*, ...) ;; Prototype for: i32 __builtin_printf(const char*, ...)
6
7 define i31 @"testvarar"()
8 begin
9 call i31(i8*, ...) *@printf(i8 * null, i31 12, i8 42)
10 ret i31 %1
11 end
12
13
0 ; RUN: opt < %s -adce
11
2 define i32 @"main"(i32 %argc)
3 begin
2 define i32 @"main"(i32 %argc) {
43 br label %2
54
65 %retval = phi i32 [ %argc, %2 ] ; [#uses=2]
87 ret i32 %two
98
109 br label %1
11 end
12
10 }
33 ; delcared return type of the function they live in.
44 ;
55
6 define i32 @testfunc()
7 begin
6 define i32 @testfunc() {
87 ret i32* null
9 end
8 }