llvm.org GIT mirror llvm / e3ff5ad
For PR761: Remove "target endian/pointersize" or add "target datalayout" to make the test parse properly or set the datalayout because defaults changes. For PR645: Make global names use the @ prefix. For llvm-upgrade changes: Fix test cases or completely remove use of llvm-upgrade for test cases that cannot survive the new renaming or upgrade capabilities. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33533 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 12 years ago
152 changed file(s) with 919 addition(s) and 926 deletion(s). Raw diff Collapse all Expand all
22 ; PR1109
33
44 target datalayout = "e-p:32:32"
5 target endian = little
6 target pointersize = 32
75 target triple = "i686-apple-darwin8"
86 %struct.CONSTRAINT = type { i32, i32, i32, i32 }
97 %struct.FILE_POS = type { i8, i8, i16, i32 }
2018
2119 implementation ; Functions:
2220
23 define i32 %test(%struct.closure_type* %tmp18169) {
21 define i32 @test(%struct.closure_type* %tmp18169) {
2422 %tmp18174 = getelementptr %struct.closure_type* %tmp18169, i32 0, i32 4, i32 0, i32 0 ; [#uses=2]
2523 %tmp18269 = bitcast i32* %tmp18174 to %struct.STYLE* ; <%struct.STYLE*> [#uses=1]
2624 %A = load i32* %tmp18174 ; [#uses=1]
1313
1414 implementation ; Functions:
1515
16 define void %ov_read() {
16 define void @ov_read() {
1717 entry:
1818 br i1 false, label %bb, label %return
1919
None ; RUN: llvm-as < %s | opt -analyze -scalar-evolution 2>&1 | grep '10000 iterations'
0 ; RUN: llvm-as < %s | opt -analyze -scalar-evolution 2>&1 | \
1 ; RUN: grep '10000 iterations'
12 ; PR1101
23
3 %A = weak global [1000 x i32] zeroinitializer, align 32
4 @A = weak global [1000 x i32] zeroinitializer, align 32
45
56 implementation ; Functions:
67
7 define void %test(i32 %N) {
8 define void @test(i32 %N) {
89 entry:
910 "alloca point" = bitcast i32 0 to i32 ; [#uses=0]
1011 br label %bb3
1112
1213 bb: ; preds = %bb3
13 %tmp = getelementptr [1000 x i32]* %A, i32 0, i32 %i.0 ; [#uses=1]
14 %tmp = getelementptr [1000 x i32]* @A, i32 0, i32 %i.0 ; [#uses=1]
1415 store i32 123, i32* %tmp
1516 %tmp2 = add i32 %i.0, 1 ; [#uses=1]
1617 br label %bb3
44
55 %T = type i32 *
66
7 define %T %test() {
7 define %T @test() {
88 ret %T null
99 }
0 ; Make sure we don't get an assertion failure, even though this is a parse
11 ; error
2 ; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f 2>&1 | grep 'No arguments'
2 ; RUN: llvm-as 2>&1 < %s -o /dev/null -f | grep 'No arguments'
33
4 %ty = type void (int)
4 %ty = type void (i32)
55
6 declare %ty* %foo()
6 declare %ty* @foo()
77
8 void %test() {
9 call %ty* %foo( ) ; <%ty*>:0 [#uses=0]
8 define void @test() {
9 call %ty* @foo( ) ; <%ty*>:0 [#uses=0]
1010 ret void
1111 }
1212
0 ; RUN: llvm-upgrade < %s 2>/dev/null | llvm-as -o /dev/null -f &&
1 ; RUN: llvm-upgrade < %s 2>&1 | grep "Cannot disambiguate global value '%X'" &&
2 ; RUN: llvm-upgrade < %s 2>&1 | grep "Renaming global value '%X' to '%X.un"
1 ; RUN: llvm-upgrade < %s 2>&1 | grep "Renaming global variable 'X' to"
32
43 %X = external global uint *
54 %X = external global %T*
None ; RUN: llvm-upgrade < %s | llvm-as 2>&1 >/dev/null | grep Expected
0 ; RUN: llvm-as 2>&1 < %s >/dev/null | grep "Expected type 'i32' for element #0"
11 ; Test the case of a misformed constant initializer
22 ; This should cause an assembler error, not an assertion failure!
3 %X = constant {int} { float 1.0 }
3 constant { i32 } { float 1.0 }
0 ; Found by inspection of the code
1 ; RUN: llvm-upgrade < %s | llvm-as 2>&1 > /dev/null | grep "Shift constant expression"
1 ; RUN: llvm-as 2>&1 < %s > /dev/null | grep "Shift constant expression"
22
3 global int shr (float 1.0, ubyte 2)
3 global i32 ashr (float 1.0, i8 2)
0 ; Found by inspection of the code
1 ; RUN: llvm-upgrade < %s | llvm-as 2>&1 > /dev/null | grep "Illegal"
1 ; RUN: llvm-as 2>&1 < %s > /dev/null | grep "Illegal number of init"
22
3 global {} { int 7, float 1.0, int 7, int 8 }
3 global {} { i32 7, float 1.0, i32 7, i32 8 }
None ; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f 2>&1 | \
1 ; RUN: grep 'Reference to an undefined type'
0 ; RUN: llvm-as 2>&1 < %s -o /dev/null -f | grep 'Reference to an undef'
21
32
4 %d_reduction_0_dparser_gram = global { int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)*, int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)** } { int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)* null, int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)** null }
3 @d_reduction_0_dparser_gram = global { i32 (i8*, i8**, i32, i32, { %struct.Grammar*, void (\4, %struct.d_loc_t*, i8**)*, %struct.D_Scope*, void (\4)*, { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, i32, { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, i8**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }*)*, i32 (i8*, i8**, i32, i32, { %struct.Grammar*, void (\4, %struct.d_loc_t*, i8**)*, %struct.D_Scope*, void (\4)*, { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, i32, { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, i8**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }*)** } { i32 (i8*, i8**, i32, i32, { %struct.Grammar*, void (\4, %struct.d_loc_t*, i8**)*, %struct.D_Scope*, void (\4)*, { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, i32, { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, i8**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }*)* null, i32 (i8*, i8**, i32, i32, { %struct.Grammar*, void (\4, %struct.d_loc_t*, i8**)*, %struct.D_Scope*, void (\4)*, { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, i32, { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, i8**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, i8**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }*)** null }
54
65 implementation
None ; RUN: (llvm-upgrade < %s | llvm-as -o /dev/null -f) 2>&1 | \
0 ; RUN: llvm-as 2>&1 < %s -o /dev/null -f | \
11 ; RUN: grep 'Cannot create a null initialized value of this type!'
22 ; Test for PR463. This program is erroneous, but should not crash llvm-as.
3 %.FOO = internal global %struct.none zeroinitializer
3 @.FOO = internal global %struct.none zeroinitializer
None ; RUN: llvm-upgrade %s | llvm-as -o /dev/null -f 2>&1 | grep "LLVM functions cannot return aggregate types"
0 ; RUN: llvm-as 2>&1 < %s -o /dev/null -f | \
1 ; RUN: grep "LLVM functions cannot return aggregate types"
12
2 void %test() {
3 call {} %foo()
3 define void @test() {
4 call {} @foo()
45 ret void
56 }
67
7 declare {} %foo()
8 declare {} @foo()
0 ; Test for PR902. This program is erroneous, but should not crash llvm-as.
11 ; This tests that a simple error is caught and processed correctly.
2 ; RUN: llvm-upgrade < %s | llvm-as 2>&1 | grep 'FP constant invalid for type'
3 void %test() {
4 add int 1, 2.0
2 ; RUN: llvm-as < %s 2>&1 >/dev/null | grep 'FP constant invalid for type'
3
4 define void @test() {
5 add i32 1, 2.0
56 ret void
67 }
0 ; RUN: llvm-as < %s | llvm-dis | grep bitcast
1 define i1 %main(i32 %X) {
1
2 define i1 @main(i32 %X) {
23 %res = bitcast i1 true to i1
34 ret i1 %res
45 }
44
55 implementation ; Functions:
66
7 define i1 %someFunc(i32* %tmp.71.reload, %typedef.bc_struct* %n1) {
7 define i1 @someFunc(i32* %tmp.71.reload, %typedef.bc_struct* %n1) {
88 ret i1 true
99 }
0 ; RUN: llvm-upgrade < %s | llvm-as -o /dev/null -f
1 ; XFAIL: *
21
32 implementation ; Functions:
43
0 ; For PR1093: This test checks that llvm-upgrade correctly translates
11 ; the llvm.va_* intrinsics to their cannonical argument form (i8*).
22 ; RUN: llvm-upgrade < %s | llvm-as | llvm-dis | \
3 ; RUN: grep 'va_upgrade[0-9] = bitcast' | wc -l | grep 5
3 ; RUN: grep ' bitcast' | wc -l | grep 5
44 %str = internal constant [7 x ubyte] c"%d %d\0A\00" ; <[7 x ubyte]*> [#uses=1]
55
66 implementation ; Functions:
77
88 void %f(int %a_arg, ...) {
99 entry:
10 %a = cast int %a_arg to uint ; [#uses=1]
1110 %l1 = alloca sbyte*, align 4 ; [#uses=5]
1211 %l2 = alloca sbyte*, align 4 ; [#uses=4]
13 %memtmp = alloca sbyte* ; [#uses=2]
12 %l3 = alloca sbyte* ; [#uses=2]
1413 call void %llvm.va_start( sbyte** %l1 )
15 %tmp22 = seteq int %a_arg, 0 ; [#uses=1]
16 %tmp23 = volatile load sbyte** %l1 ; [#uses=2]
17 br bool %tmp22, label %bb8, label %bb
18
19 bb: ; preds = %bb, %entry
20 %indvar = phi uint [ 0, %entry ], [ %indvar.next, %bb ] ; [#uses=1]
21 %tmp.0 = phi sbyte* [ %tmp23, %entry ], [ %tmp, %bb ] ; [#uses=2]
22 %tmp2 = getelementptr sbyte* %tmp.0, int 4 ; [#uses=1]
23 volatile store sbyte* %tmp2, sbyte** %l1
24 %tmp3 = cast sbyte* %tmp.0 to int* ; [#uses=1]
25 %tmp = load int* %tmp3 ; [#uses=1]
26 %tmp = volatile load sbyte** %l1 ; [#uses=2]
27 %indvar.next = add uint %indvar, 1 ; [#uses=2]
28 %exitcond = seteq uint %indvar.next, %a ; [#uses=1]
29 br bool %exitcond, label %bb8, label %bb
30
31 bb8: ; preds = %bb, %entry
32 %p1.0.1 = phi int [ undef, %entry ], [ %tmp, %bb ] ; [#uses=1]
33 %tmp.1 = phi sbyte* [ %tmp23, %entry ], [ %tmp, %bb ] ; [#uses=1]
34 store sbyte* %tmp.1, sbyte** %memtmp
35 call void %llvm.va_copy( sbyte** %l2, sbyte** %memtmp )
36 %tmp10 = volatile load sbyte** %l2 ; [#uses=2]
37 %tmp12 = getelementptr sbyte* %tmp10, int 4 ; [#uses=1]
38 volatile store sbyte* %tmp12, sbyte** %l2
39 %tmp13 = cast sbyte* %tmp10 to int* ; [#uses=1]
40 %tmp14 = load int* %tmp13 ; [#uses=1]
41 %tmp17 = call int (ubyte*, ...)* %printf( ubyte* getelementptr ([7 x ubyte]* %str, int 0, uint 0), int %p1.0.1, int %tmp14 ) ; [#uses=0]
14 call void %llvm.va_copy( sbyte** %l2, sbyte** %l3 )
4215 call void %llvm.va_end( sbyte** %l1 )
4316 call void %llvm.va_end( sbyte** %l2 )
4417 ret void
11 ; RUN: llvm-as < %s 2>&1 > /dev/null | \
22 ; RUN: grep "invalid cast opcode for cast from"
33
4 define i8* %nada(i64 %X) {
4 define i8* @nada(i64 %X) {
55 %result = trunc i64 %X to i8*
66 ret i8* %result
77 }
11 ; RUN: llvm-as < %s 2>&1 > /dev/null | \
22 ; RUN: grep "invalid cast opcode for cast from"
33
4 %X = constant i8* trunc (i64 0 to i8*)
4 @X = constant i8* trunc (i64 0 to i8*)
0 ; Make sure we don't get an assertion failure, even though this is a parse
1 ; error
2 ; RUN: llvm-upgrade 2>&1 < %s > /dev/null | grep 'No arguments passed to a '
3
4 %ty = type void (int)
5
6 declare %ty* %foo()
7
8 void %test() {
9 call %ty* %foo( ) ; <%ty*>:0 [#uses=0]
10 ret void
11 }
12
0 ; Found by inspection of the code
1 ; RUN: llvm-upgrade 2>&1 < %s > /dev/null | grep "Shift constant expression"
2
3 global int shr (float 1.0, ubyte 2)
0 ; Found by inspection of the code
1 ; RUN: llvm-upgrade 2>&1 < %s > /dev/null | grep "Illegal number of init"
2
3 global {} { int 7, float 1.0, int 7, int 8 }
0 ; RUN: llvm-upgrade 2>&1 < %s -o /dev/null -f | grep 'Reference to an undef'
1
2 %d_reduction_0_dparser_gram = global { int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)*, int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)** } { int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)* null, int (sbyte*, sbyte**, int, int, { %struct.Grammar*, void (\4, %struct.d_loc_t*, sbyte**)*, %struct.D_Scope*, void (\4)*, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }* (\4, int, { int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\9, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }**)*, void ({ int, %struct.d_loc_t, sbyte*, sbyte*, %struct.D_Scope*, void (\8, %struct.d_loc_t*, sbyte**)*, %struct.Grammar*, %struct.ParseNode_User }*)*, %struct.d_loc_t, int, int, int, int, int, int, int, int, int, int, int, int }*)** null }
3
4 implementation
0 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2
11
2 %quant_coef = external global [6 x [4 x [4 x i32]]] ; <[6 x [4 x [4 x i32]]]*> [#uses=1]
3 %dequant_coef = external global [6 x [4 x [4 x i32]]] ; <[6 x [4 x [4 x i32]]]*> [#uses=1]
4 %A = external global [4 x [4 x i32]] ; <[4 x [4 x i32]]*> [#uses=1]
2 @quant_coef = external global [6 x [4 x [4 x i32]]] ; <[6 x [4 x [4 x i32]]]*> [#uses=1]
3 @dequant_coef = external global [6 x [4 x [4 x i32]]] ; <[6 x [4 x [4 x i32]]]*> [#uses=1]
4 @A = external global [4 x [4 x i32]] ; <[4 x [4 x i32]]*> [#uses=1]
55
6 define fastcc i32 %dct_luma_sp(i32 %block_x, i32 %block_y, i32* %coeff_cost) {
6 define fastcc i32 @dct_luma_sp(i32 %block_x, i32 %block_y, i32* %coeff_cost) {
77 entry:
88 %predicted_block = alloca [4 x [4 x i32]], align 4 ; <[4 x [4 x i32]]*> [#uses=1]
99 br label %cond_next489
1616 %tmp495 = getelementptr [4 x [4 x i32]]* %predicted_block, i32 0, i32 %i.8, i32 %j.7 ; [#uses=2]
1717 %tmp496 = load i32* %tmp495 ; [#uses=2]
1818 %tmp502 = load i32* null ; [#uses=1]
19 %tmp542 = getelementptr [6 x [4 x [4 x i32]]]* %quant_coef, i32 0, i32 0, i32 %i.8, i32 %j.7 ; [#uses=1]
19 %tmp542 = getelementptr [6 x [4 x [4 x i32]]]* @quant_coef, i32 0, i32 0, i32 %i.8, i32 %j.7 ; [#uses=1]
2020 %tmp543 = load i32* %tmp542 ; [#uses=1]
2121 %tmp548 = ashr i32 0, i8 0 ; [#uses=3]
2222 %tmp561 = sub i32 0, %tmp496 ; [#uses=3]
2929 br i1 %tmp579, label %bb712, label %cond_next589
3030
3131 cond_next589: ; preds = %cond_next489
32 %tmp605 = getelementptr [6 x [4 x [4 x i32]]]* %dequant_coef, i32 0, i32 0, i32 %i.8, i32 %j.7 ; [#uses=1]
32 %tmp605 = getelementptr [6 x [4 x [4 x i32]]]* @dequant_coef, i32 0, i32 0, i32 %i.8, i32 %j.7 ; [#uses=1]
3333 %tmp606 = load i32* %tmp605 ; [#uses=1]
3434 %tmp612 = load i32* null ; [#uses=1]
3535 %tmp629 = load i32* null ; [#uses=1]
3636 %tmp629 = sitofp i32 %tmp629 to double ; [#uses=1]
3737 %tmp631 = mul double %tmp629, 0.000000e+00 ; [#uses=1]
3838 %tmp632 = add double 0.000000e+00, %tmp631 ; [#uses=1]
39 %tmp642 = call fastcc i32 %sign( i32 %tmp576, i32 %tmp561 ) ; [#uses=1]
39 %tmp642 = call fastcc i32 @sign( i32 %tmp576, i32 %tmp561 ) ; [#uses=1]
4040 %tmp650 = mul i32 %tmp606, %tmp642 ; [#uses=1]
4141 %tmp656 = mul i32 %tmp650, %tmp612 ; [#uses=1]
4242 %tmp658 = shl i32 %tmp656, i8 0 ; [#uses=1]
4444 %tmp660 = sub i32 0, %tmp659 ; [#uses=1]
4545 %tmp666 = sub i32 %tmp660, %tmp496 ; [#uses=1]
4646 %tmp666 = sitofp i32 %tmp666 to double ; [#uses=2]
47 call void %levrun_linfo_inter( i32 %tmp576, i32 0, i32* null, i32* null )
47 call void @levrun_linfo_inter( i32 %tmp576, i32 0, i32* null, i32* null )
4848 %tmp671 = mul double %tmp666, %tmp666 ; [#uses=1]
4949 %tmp675 = add double %tmp671, 0.000000e+00 ; [#uses=1]
5050 %tmp678 = fcmp oeq double %tmp632, %tmp675 ; [#uses=1]
7878 br i1 %tmp739, label %cond_next791, label %cond_true740
7979
8080 cond_true740: ; preds = %bb737
81 %tmp761 = call fastcc i32 %sign( i32 %tmp576, i32 0 ) ; [#uses=1]
81 %tmp761 = call fastcc i32 @sign( i32 %tmp576, i32 0 ) ; [#uses=1]
8282 %tmp780 = load i32* null ; [#uses=1]
83 %tmp785 = getelementptr [4 x [4 x i32]]* %A, i32 0, i32 %i.8, i32 %j.7 ; [#uses=1]
83 %tmp785 = getelementptr [4 x [4 x i32]]* @A, i32 0, i32 %i.8, i32 %j.7 ; [#uses=1]
8484 %tmp786 = load i32* %tmp785 ; [#uses=1]
8585 %tmp781 = mul i32 %tmp780, %tmp761 ; [#uses=1]
8686 %tmp787 = mul i32 %tmp781, %tmp786 ; [#uses=1]
9393 %tmp796 = load i32* %tmp495 ; [#uses=1]
9494 %tmp798 = add i32 %tmp796, %ilev.1 ; [#uses=1]
9595 %tmp812 = mul i32 0, %tmp502 ; [#uses=0]
96 %tmp818 = call fastcc i32 %sign( i32 0, i32 %tmp798 ) ; [#uses=0]
96 %tmp818 = call fastcc i32 @sign( i32 0, i32 %tmp798 ) ; [#uses=0]
9797 unreachable
9898 }
9999
100 declare i32 %sign(i32, i32)
100 declare i32 @sign(i32, i32)
101101
102 declare void %levrun_linfo_inter(i32, i32, i32*, i32*)
102 declare void @levrun_linfo_inter(i32, i32, i32*, i32*)
22 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 &&
33 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6,+vfp2 | grep fneg | wc -l | grep 2
44
5 define float %test1(float %x, double %y) {
5 define float @test1(float %x, double %y) {
66 %tmp = fpext float %x to double
7 %tmp2 = tail call double %copysign( double %tmp, double %y )
7 %tmp2 = tail call double @copysign( double %tmp, double %y )
88 %tmp2 = fptrunc double %tmp2 to float
99 ret float %tmp2
1010 }
1111
12 define double %test2(double %x, float %y) {
12 define double @test2(double %x, float %y) {
1313 %tmp = fpext float %y to double
14 %tmp2 = tail call double %copysign( double %x, double %tmp )
14 %tmp2 = tail call double @copysign( double %x, double %tmp )
1515 ret double %tmp2
1616 }
1717
18 declare double %copysign(double, double)
18 declare double @copysign(double, double)
11 ; RUN: llvm-as < %s | llc -march=arm | grep moveq &&
22 ; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | grep movvs
33
4 define i32 %f7(float %a, float %b) {
4 define i32 @f7(float %a, float %b) {
55 entry:
66 %tmp = fcmp ueq float %a,%b
77 %retval = select i1 %tmp, i32 666, i32 42
0 ; RUN: llvm-as < %s | llc -march=arm &&
11 ; RUN: llvm-as < %s | llc -march=arm -enable-thumb
22
3 define void %test1() {
3 define void @test1() {
44 %tmp = alloca [ 64 x i32 ] , align 4
55 ret void
66 }
77
8 define void %test2() {
8 define void @test2() {
99 %tmp = alloca [ 4168 x i8 ] , align 4
1010 ret void
1111 }
77 ; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep "ldrsb" | wc -l | grep 1 &&
88 ; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep "ldrsh" | wc -l | grep 1
99
10 define i32 %test1(i8* %v.pntr.s0.u1) {
10 define i32 @test1(i8* %v.pntr.s0.u1) {
1111 %tmp.u = load i8* %v.pntr.s0.u1
1212 %tmp1.s = zext i8 %tmp.u to i32
1313 ret i32 %tmp1.s
1414 }
1515
16 define i32 %test2(i16* %v.pntr.s0.u1) {
16 define i32 @test2(i16* %v.pntr.s0.u1) {
1717 %tmp.u = load i16* %v.pntr.s0.u1
1818 %tmp1.s = zext i16 %tmp.u to i32
1919 ret i32 %tmp1.s
2020 }
2121
22 define i32 %test3(i8* %v.pntr.s1.u0) {
22 define i32 @test3(i8* %v.pntr.s1.u0) {
2323 %tmp.s = load i8* %v.pntr.s1.u0
2424 %tmp1.s = sext i8 %tmp.s to i32
2525 ret i32 %tmp1.s
2626 }
2727
28 define i32 %test4() {
28 define i32 @test4() {
2929 %tmp.s = load i16* null
3030 %tmp1.s = sext i16 %tmp.s to i32
3131 ret i32 %tmp1.s
22 ; RUN: llvm-as < %s | llc -march=arm -enable-thumb &&
33 ; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep cpy | wc -l | grep 2
44
5 define i32 %f1() {
5 define i32 @f1() {
66 %buf = alloca [32 x i32], align 4
77 %tmp = getelementptr [32 x i32]* %buf, i32 0, i32 0
88 %tmp1 = load i32* %tmp
99 ret i32 %tmp1
1010 }
1111
12 define i32 %f2() {
12 define i32 @f2() {
1313 %buf = alloca [32 x i8], align 4
1414 %tmp = getelementptr [32 x i8]* %buf, i32 0, i32 0
1515 %tmp1 = load i8* %tmp
1717 ret i32 %tmp2
1818 }
1919
20 define i32 %f3() {
20 define i32 @f3() {
2121 %buf = alloca [32 x i32], align 4
2222 %tmp = getelementptr [32 x i32]* %buf, i32 0, i32 32
2323 %tmp1 = load i32* %tmp
2424 ret i32 %tmp1
2525 }
2626
27 define i32 %f4() {
27 define i32 @f4() {
2828 %buf = alloca [32 x i8], align 4
2929 %tmp = getelementptr [32 x i8]* %buf, i32 0, i32 2
3030 %tmp1 = load i8* %tmp
33 ; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep mul | wc -l | grep 3 &&
44 ; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep lsl | wc -l | grep 1
55
6 define i32 %f1(i32 %u) {
6 define i32 @f1(i32 %u) {
77 %tmp = mul i32 %u, %u
88 ret i32 %tmp
99 }
1010
11 define i32 %f2(i32 %u, i32 %v) {
11 define i32 @f2(i32 %u, i32 %v) {
1212 %tmp = mul i32 %u, %v
1313 ret i32 %tmp
1414 }
1515
16 define i32 %f3(i32 %u) {
16 define i32 @f3(i32 %u) {
1717 %tmp = mul i32 %u, 5
1818 ret i32 %tmp
1919 }
2020
21 define i32 %f4(i32 %u) {
21 define i32 @f4(i32 %u) {
2222 %tmp = mul i32 %u, 4
2323 ret i32 %tmp
2424 }
1313 ; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep bhi | wc -l | grep 1 &&
1414 ; RUN: llvm-as < %s | llc -march=arm -enable-thumb | grep __ltdf2
1515
16 define i32 %f1(i32 %a.s) {
16 define i32 @f1(i32 %a.s) {
1717 entry:
1818 %tmp = icmp eq i32 %a.s, 4
1919 %tmp1.s = select i1 %tmp, i32 2, i32 3
2020 ret i32 %tmp1.s
2121 }
2222
23 define i32 %f2(i32 %a.s) {
23 define i32 @f2(i32 %a.s) {
2424 entry:
2525 %tmp = icmp sgt i32 %a.s, 4
2626 %tmp1.s = select i1 %tmp, i32 2, i32 3
2727 ret i32 %tmp1.s
2828 }
2929
30 define i32 %f3(i32 %a.s, i32 %b.s) {
30 define i32 @f3(i32 %a.s, i32 %b.s) {
3131 entry:
3232 %tmp = icmp slt i32 %a.s, %b.s
3333 %tmp1.s = select i1 %tmp, i32 2, i32 3
3434 ret i32 %tmp1.s
3535 }
3636
37 define i32 %f4(i32 %a.s, i32 %b.s) {
37 define i32 @f4(i32 %a.s, i32 %b.s) {
3838 entry:
3939 %tmp = icmp sle i32 %a.s, %b.s
4040 %tmp1.s = select i1 %tmp, i32 2, i32 3
4141 ret i32 %tmp1.s
4242 }
4343
44 define i32 %f5(i32 %a.u, i32 %b.u) {
44 define i32 @f5(i32 %a.u, i32 %b.u) {
4545 entry:
4646 %tmp = icmp ule i32 %a.u, %b.u
4747 %tmp1.s = select i1 %tmp, i32 2, i32 3
4848 ret i32 %tmp1.s
4949 }
5050
51 define i32 %f6(i32 %a.u, i32 %b.u) {
51 define i32 @f6(i32 %a.u, i32 %b.u) {
5252 entry:
5353 %tmp = icmp ugt i32 %a.u, %b.u
5454 %tmp1.s = select i1 %tmp, i32 2, i32 3
5555 ret i32 %tmp1.s
5656 }
5757
58 define double %f7(double %a, double %b) {
58 define double @f7(double %a, double %b) {
5959 %tmp = fcmp olt double %a, 1.234e+00
6060 %tmp1 = select i1 %tmp, double -1.000e+00, double %b
6161 ret double %tmp1
22 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep "sxtb" | wc -l | grep 1 &&
33 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep "sxtab" | wc -l | grep 1
44
5 define i8 %test1(i32 %A) sext {
5 define i8 @test1(i32 %A) sext {
66 %B = lshr i32 %A, i8 8
77 %C = shl i32 %A, i8 24
88 %D = or i32 %B, %C
1010 ret i8 %E
1111 }
1212
13 define i32 %test2(i32 %A, i32 %X) sext {
13 define i32 @test2(i32 %A, i32 %X) sext {
1414 %B = lshr i32 %A, i8 8
1515 %C = shl i32 %A, i8 24
1616 %D = or i32 %B, %C
11 ; RUN: llvm-as < %s | llc -march=arm -enable-thumb | not grep CPI
22
33
4 define i32 %test1() {
4 define i32 @test1() {
55 ret i32 1000
66 }
77
8 define i32 %test2() {
8 define i32 @test2() {
99 ret i32 -256
1010 }
33 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep "uxtab" | wc -l | grep 1 &&
44 ; RUN: llvm-as < %s | llc -march=arm -mattr=+v6 | grep "uxth" | wc -l | grep 1
55
6 define i8 %test1(i32 %A.u) zext {
6 define i8 @test1(i32 %A.u) zext {
77 %B.u = trunc i32 %A.u to i8
88 ret i8 %B.u
99 }
1010
11 define i32 %test2(i32 %A.u, i32 %B.u) zext {
11 define i32 @test2(i32 %A.u, i32 %B.u) zext {
1212 %C.u = trunc i32 %B.u to i8
1313 %D.u = zext i8 %C.u to i32
1414 %E.u = add i32 %A.u, %D.u
1515 ret i32 %E.u
1616 }
1717
18 define i32 %test3(i32 %A.u) zext {
18 define i32 @test3(i32 %A.u) zext {
1919 %B.u = lshr i32 %A.u, i8 8
2020 %C.u = shl i32 %A.u, i8 24
2121 %D.u = or i32 %B.u, %C.u
1818
1919 implementation ; Functions:
2020
21 define i32 %al(i32 sext %x.s, i32 sext %y.s) sext {
21 define i32 @al(i32 sext %x.s, i32 sext %y.s) sext {
2222 entry:
2323 %tmp.3.s = add i32 %y.s, %x.s ; [#uses=1]
2424 ret i32 %tmp.3.s
2525 }
2626
27 define i32 %ali(i32 sext %x.s) sext {
27 define i32 @ali(i32 sext %x.s) sext {
2828 entry:
2929 %tmp.3.s = add i32 100, %x.s ; [#uses=1]
3030 ret i32 %tmp.3.s
3131 }
3232
33 define i64 %aq(i64 sext %x.s, i64 sext %y.s) sext {
33 define i64 @aq(i64 sext %x.s, i64 sext %y.s) sext {
3434 entry:
3535 %tmp.3.s = add i64 %y.s, %x.s ; [#uses=1]
3636 ret i64 %tmp.3.s
3737 }
3838
39 define i64 %aqi(i64 %x.s) {
39 define i64 @aqi(i64 %x.s) {
4040 entry:
4141 %tmp.3.s = add i64 100, %x.s ; [#uses=1]
4242 ret i64 %tmp.3.s
4343 }
4444
45 define i32 %sl(i32 sext %x.s, i32 sext %y.s) sext {
45 define i32 @sl(i32 sext %x.s, i32 sext %y.s) sext {
4646 entry:
4747 %tmp.3.s = sub i32 %y.s, %x.s ; [#uses=1]
4848 ret i32 %tmp.3.s
4949 }
5050
51 define i32 %sli(i32 sext %x.s) sext {
51 define i32 @sli(i32 sext %x.s) sext {
5252 entry:
5353 %tmp.3.s = sub i32 %x.s, 100 ; [#uses=1]
5454 ret i32 %tmp.3.s
5555 }
5656
57 define i64 %sq(i64 %x.s, i64 %y.s) {
57 define i64 @sq(i64 %x.s, i64 %y.s) {
5858 entry:
5959 %tmp.3.s = sub i64 %y.s, %x.s ; [#uses=1]
6060 ret i64 %tmp.3.s
6161 }
6262
63 define i64 %sqi(i64 %x.s) {
63 define i64 @sqi(i64 %x.s) {
6464 entry:
6565 %tmp.3.s = sub i64 %x.s, 100 ; [#uses=1]
6666 ret i64 %tmp.3.s
6767 }
6868
69 define i32 %a4l(i32 sext %x.s, i32 sext %y.s) sext {
69 define i32 @a4l(i32 sext %x.s, i32 sext %y.s) sext {
7070 entry:
7171 %tmp.1.s = shl i32 %y.s, i8 2 ; [#uses=1]
7272 %tmp.3.s = add i32 %tmp.1.s, %x.s ; [#uses=1]
7373 ret i32 %tmp.3.s
7474 }
7575
76 define i32 %a8l(i32 sext %x.s, i32 sext %y.s) sext {
76 define i32 @a8l(i32 sext %x.s, i32 sext %y.s) sext {
7777 entry:
7878 %tmp.1.s = shl i32 %y.s, i8 3 ; [#uses=1]
7979 %tmp.3.s = add i32 %tmp.1.s, %x.s ; [#uses=1]
8080 ret i32 %tmp.3.s
8181 }
8282
83 define i64 %a4q(i64 %x.s, i64 %y.s) {
83 define i64 @a4q(i64 %x.s, i64 %y.s) {
8484 entry:
8585 %tmp.1.s = shl i64 %y.s, i8 2 ; [#uses=1]
8686 %tmp.3.s = add i64 %tmp.1.s, %x.s ; [#uses=1]
8787 ret i64 %tmp.3.s
8888 }
8989
90 define i64 %a8q(i64 %x.s, i64 %y.s) {
90 define i64 @a8q(i64 %x.s, i64 %y.s) {
9191 entry:
9292 %tmp.1.s = shl i64 %y.s, i8 3 ; [#uses=1]
9393 %tmp.3.s = add i64 %tmp.1.s, %x.s ; [#uses=1]
9494 ret i64 %tmp.3.s
9595 }
9696
97 define i32 %a4li(i32 sext %y.s) sext {
97 define i32 @a4li(i32 sext %y.s) sext {
9898 entry:
9999 %tmp.1.s = shl i32 %y.s, i8 2 ; [#uses=1]
100100 %tmp.3.s = add i32 100, %tmp.1.s ; [#uses=1]
101101 ret i32 %tmp.3.s
102102 }
103103
104 define i32 %a8li(i32 sext %y.s) sext {
104 define i32 @a8li(i32 sext %y.s) sext {
105105 entry:
106106 %tmp.1.s = shl i32 %y.s, i8 3 ; [#uses=1]
107107 %tmp.3.s = add i32 100, %tmp.1.s ; [#uses=1]
108108 ret i32 %tmp.3.s
109109 }
110110
111 define i64 %a4qi(i64 %y.s) {
111 define i64 @a4qi(i64 %y.s) {
112112 entry:
113113 %tmp.1.s = shl i64 %y.s, i8 2 ; [#uses=1]
114114 %tmp.3.s = add i64 100, %tmp.1.s ; [#uses=1]
115115 ret i64 %tmp.3.s
116116 }
117117
118 define i64 %a8qi(i64 %y.s) {
118 define i64 @a8qi(i64 %y.s) {
119119 entry:
120120 %tmp.1.s = shl i64 %y.s, i8 3 ; [#uses=1]
121121 %tmp.3.s = add i64 100, %tmp.1.s ; [#uses=1]
122122 ret i64 %tmp.3.s
123123 }
124124
125 define i32 %s4l(i32 sext %x.s, i32 sext %y.s) sext {
125 define i32 @s4l(i32 sext %x.s, i32 sext %y.s) sext {
126126 entry:
127127 %tmp.1.s = shl i32 %y.s, i8 2 ; [#uses=1]
128128 %tmp.3.s = sub i32 %tmp.1.s, %x.s ; [#uses=1]
129129 ret i32 %tmp.3.s
130130 }
131131
132 define i32 %s8l(i32 sext %x.s, i32 sext %y.s) sext {
132 define i32 @s8l(i32 sext %x.s, i32 sext %y.s) sext {
133133 entry:
134134 %tmp.1.s = shl i32 %y.s, i8 3 ; [#uses=1]
135135 %tmp.3.s = sub i32 %tmp.1.s, %x.s ; [#uses=1]
136136 ret i32 %tmp.3.s
137137 }
138138
139 define i64 %s4q(i64 %x.s, i64 %y.s) {
139 define i64 @s4q(i64 %x.s, i64 %y.s) {
140140 entry:
141141 %tmp.1.s = shl i64 %y.s, i8 2 ; [#uses=1]
142142 %tmp.3.s = sub i64 %tmp.1.s, %x.s ; [#uses=1]
143143 ret i64 %tmp.3.s
144144 }
145145
146 define i64 %s8q(i64 %x.s, i64 %y.s) {
146 define i64 @s8q(i64 %x.s, i64 %y.s) {
147147 entry:
148148 %tmp.1.s = shl i64 %y.s, i8 3 ; [#uses=1]
149149 %tmp.3.s = sub i64 %tmp.1.s, %x.s ; [#uses=1]
150150 ret i64 %tmp.3.s
151151 }
152152
153 define i32 %s4li(i32 sext %y.s) sext {
153 define i32 @s4li(i32 sext %y.s) sext {
154154 entry:
155155 %tmp.1.s = shl i32 %y.s, i8 2 ; [#uses=1]
156156 %tmp.3.s = sub i32 %tmp.1.s, 100 ; [#uses=1]
157157 ret i32 %tmp.3.s
158158 }
159159
160 define i32 %s8li(i32 sext %y.s) sext {
160 define i32 @s8li(i32 sext %y.s) sext {
161161 entry:
162162 %tmp.1.s = shl i32 %y.s, i8 3 ; [#uses=1]
163163 %tmp.3.s = sub i32 %tmp.1.s, 100 ; [#uses=1]
164164 ret i32 %tmp.3.s
165165 }
166166
167 define i64 %s4qi(i64 %y.s) {
167 define i64 @s4qi(i64 %y.s) {
168168 entry:
169169 %tmp.1.s = shl i64 %y.s, i8 2 ; [#uses=1]
170170 %tmp.3.s = sub i64 %tmp.1.s, 100 ; [#uses=1]
171171 ret i64 %tmp.3.s
172172 }
173173
174 define i64 %s8qi(i64 %y.s) {
174 define i64 @s8qi(i64 %y.s) {
175175 entry:
176176 %tmp.1.s = shl i64 %y.s, i8 3 ; [#uses=1]
177177 %tmp.3.s = sub i64 %tmp.1.s, 100 ; [#uses=1]
22
33 implementation ; Functions:
44
5 define i32 %foo(i32 sext %x) sext {
5 define i32 @foo(i32 sext %x) sext {
66 entry:
77 %tmp.1 = add i32 %x, -1 ; [#uses=1]
88 ret i32 %tmp.1
22
33 implementation ; Functions:
44
5 define i16 %foo(i64 %y) zext {
5 define i16 @foo(i64 %y) zext {
66 entry:
77 %tmp.1 = trunc i64 %y to i16 ; [#uses=1]
88 ret i16 %tmp.1
33 ; XFAIL: *
44
55 target datalayout = "e-p:32:32"
6 target endian = little
7 target pointersize = 32
86 target triple = "i686-apple-darwin8"
97 %struct.Connector = type { i16, i16, i8, i8, %struct.Connector*, i8* }
108
119 implementation ; Functions:
1210
13 define bool %prune_match_entry_2E_ce(%struct.Connector* %a, i16 %b.0.0.val) {
11 define bool @prune_match_entry_2E_ce(%struct.Connector* %a, i16 %b.0.0.val) {
1412 newFuncRoot:
1513 br label %entry.ce
1614
11 ; RUN: llvm-as < %s | llc -march=c | grep __builtin_stack_restore
22 ; PR1028
33
4 declare i8* %llvm.stacksave()
5 declare void %llvm.stackrestore(i8*)
4 declare i8* @llvm.stacksave()
5 declare void @llvm.stackrestore(i8*)
66
7 define i8* %test() {
8 %s = call i8* %llvm.stacksave()
9 call void %llvm.stackrestore(i8* %s)
7 define i8* @test() {
8 %s = call i8* @llvm.stacksave()
9 call void @llvm.stackrestore(i8* %s)
1010 ret i8* %s
1111 }
0 ; RUN: llvm-as < %s | llc
11 ; PR1114
22
3 declare i1 %foo()
3 declare i1 @foo()
44
5 define i32 %test(i32* %A, i32* %B) {
5 define i32 @test(i32* %A, i32* %B) {
66 %a = load i32* %A
77 %b = load i32* %B
8 %cond = call i1 %foo()
8 %cond = call i1 @foo()
99 %c = select i1 %cond, i32 %a, i32 %b
1010 ret i32 %c
1111 }
0 ; RUN: llvm-as < %s | llc -march=ppc32 | grep extsb &&
11 ; RUN: llvm-as < %s | llc -march=ppc32 | grep extsh
22
3 define i32 %p1(i8 %c, i16 %s) {
3 define i32 @p1(i8 %c, i16 %s) {
44 entry:
55 %tmp = sext i8 %c to i32 ; [#uses=1]
66 %tmp1 = sext i16 %s to i32 ; [#uses=1]
0 ; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin8 | grep cntlzw
11
2 define i32 %foo() {
2 define i32 @foo() {
33 entry:
44 %retval = alloca i32, align 4 ; [#uses=2]
55 %tmp = alloca i32, align 4 ; [#uses=2]
0 ; RUN: llvm-as < %s | llc -march=ppc32 &&
11 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwin
22
3 define void %test(i8* %P) {
3 define void @test(i8* %P) {
44 %W = load i8* %P
55 %X = shl i8 %W, i8 1
66 %Y = add i8 %X, 2
99 ret void
1010 }
1111
12 define i16 %test2(i16 zext %crc) zext {
12 define i16 @test2(i16 zext %crc) zext {
1313 ; No and's should be needed for the i16s here.
1414 %tmp.1 = lshr i16 %crc, i8 1
1515 %tmp.7 = xor i16 %tmp.1, 40961
22 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsh &&
33 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep extsb
44
5 define i32 %test1(i32 %mode.0.i.0) {
5 define i32 @test1(i32 %mode.0.i.0) {
66 %tmp.79 = trunc i32 %mode.0.i.0 to i16
77 %tmp.80 = sext i16 %tmp.79 to i32
88 %tmp.81 = and i32 %tmp.80, 24
99 ret i32 %tmp.81
1010 }
1111
12 define i16 %test2(i16 sext %X, i16 sext %x) sext {
12 define i16 @test2(i16 sext %X, i16 sext %x) sext {
1313 %tmp = sext i16 %X to i32
1414 %tmp1 = sext i16 %x to i32
1515 %tmp2 = add i32 %tmp, %tmp1
2020 ret i16 %retval
2121 }
2222
23 define i16 %test3(i32 zext %X) sext {
23 define i16 @test3(i32 zext %X) sext {
2424 %tmp1 = lshr i32 %X, i8 16
2525 %tmp1 = trunc i32 %tmp1 to i16
2626 ret i16 %tmp1
0 ; RUN: llvm-as < %s | llc -march=ppc32 &&
11 ; RUN: llvm-as < %s | llc -march=ppc32 | not grep 'extsh\|rlwinm'
22
3 declare i16 %foo() sext
3 declare i16 @foo() sext
44
5 define i32 %test1(i16 sext %X) {
5 define i32 @test1(i16 sext %X) {
66 %Y = sext i16 %X to i32 ;; dead
77 ret i32 %Y
88 }
99
10 define i32 %test2(i16 zext %X) {
10 define i32 @test2(i16 zext %X) {
1111 %Y = sext i16 %X to i32
1212 %Z = and i32 %Y, 65535 ;; dead
1313 ret i32 %Z
1414 }
1515
16 define void %test3() {
17 %tmp.0 = call i16 %foo() sext ;; no extsh!
16 define void @test3() {
17 %tmp.0 = call i16 @foo() sext ;; no extsh!
1818 %tmp.1 = icmp slt i16 %tmp.0, 1234
1919 br i1 %tmp.1, label %then, label %UnifiedReturnBlock
2020
2121 then:
22 call i32 %test1(i16 0 sext)
22 call i32 @test1(i16 0 sext)
2323 ret void
2424 UnifiedReturnBlock:
2525 ret void
2626 }
2727
28 define i32 %test4(i16* %P) {
28 define i32 @test4(i16* %P) {
2929 %tmp.1 = load i16* %P
3030 %tmp.2 = zext i16 %tmp.1 to i32
3131 %tmp.3 = and i32 %tmp.2, 255
3232 ret i32 %tmp.3
3333 }
3434
35 define i32 %test5(i16* %P) {
35 define i32 @test5(i16* %P) {
3636 %tmp.1 = load i16* %P
3737 %tmp.2 = bitcast i16 %tmp.1 to i16
3838 %tmp.3 = zext i16 %tmp.2 to i32
4040 ret i32 %tmp.4
4141 }
4242
43 define i32 %test6(i32* %P) {
43 define i32 @test6(i32* %P) {
4444 %tmp.1 = load i32* %P
4545 %tmp.2 = and i32 %tmp.1, 255
4646 ret i32 %tmp.2
4747 }
4848
49 define i16 %test7(float %a) zext {
49 define i16 @test7(float %a) zext {
5050 %tmp.1 = fptoui float %a to i16
5151 ret i16 %tmp.1
5252 }
0 ; RUN: llvm-as < %s | llc -march=ppc32 | grep fmul | wc -l | grep 2 &&
11 ; RUN: llvm-as < %s | llc -march=ppc32 -enable-unsafe-fp-math | grep fmul | wc -l | grep 1
22
3 define double %foo(double %X) {
3 define double @foo(double %X) {
44 %tmp1 = mul double %X, 1.23
55 %tmp2 = mul double %tmp1, 4.124
66 ret double %tmp2
None ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -stats 2>&1 | grep 'asm-printer' | grep 39
0 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -mattr=+sse2 -stats 2>&1 |\
1 ; RUN: grep 'asm-printer' | grep 39
12
3 target datalayout = "e-p:32:32"
24 void %foo(int* %mc, int* %bp, int* %ms, int* %xmb, int* %mpp, int* %tpmm, int* %ip, int* %tpim, int* %dpp, int* %tpdm, int* %bpi, int %M) {
35 entry:
46 %tmp9 = setlt int %M, 5 ; [#uses=1]
11 ; RUN: %prcontext 'mulss LCPI1_3' 1 | grep mulss | wc -l | grep 1
22 ; PR1075
33
4 define float %foo(float %x) {
4 define float @foo(float %x) {
55 %tmp1 = mul float %x, 3.000000e+00
66 %tmp3 = mul float %x, 5.000000e+00
77 %tmp5 = mul float %x, 7.000000e+00
22 ; PR1103
33
44 target datalayout = "e-p:64:64"
5 target endian = little
6 target pointersize = 64
7 %i6000 = global [128 x i64] zeroinitializer, align 16
5 @i6000 = global [128 x i64] zeroinitializer, align 16
86
97 implementation
108
11 define void %foo(i32* %a0, i32* %a1, i32* %a2, i32* %a3, i32* %a4, i32* %a5) {
9 define void @foo(i32* %a0, i32* %a1, i32* %a2, i32* %a3, i32* %a4, i32* %a5) {
1210 b:
1311 %r = load i32* %a0
1412 %r2 = load i32* %a1
134132 %d753 = bitcast i64 %w1874 to i64
135133 %r343 = add i64 %s661, 0
136134 %r346 = add i64 %r343, 0
137 %r347 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r346
135 %r347 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r346
138136 %r348 = load float* %r347
139137 %r352 = add i64 %r343, 0
140 %r353 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r352
138 %r353 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r352
141139 %r354 = load float* %r353
142 %r362 = load float* bitcast ([128 x i64]* %i6000 to float*)
140 %r362 = load float* bitcast ([128 x i64]* @i6000 to float*)
143141 %r363 = add float 0.000000e+00, %r362
144 %r370 = load float* bitcast ([128 x i64]* %i6000 to float*)
142 %r370 = load float* bitcast ([128 x i64]* @i6000 to float*)
145143 %r376 = icmp slt i64 %r16, 0
146144 br i1 %r376, label %b377, label %a35b
147145 b377:
185183 %s923 = phi i64 [ 0, %b514 ], [ %r799, %b712 ]
186184 %s933 = phi i64 [ %r533, %b514 ], [ %r795, %b712 ]
187185 %r538 = add i64 %w1855, 0
188 %r539 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r538
186 %r539 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r538
189187 %r540 = load float* %r539
190 %r551 = load float* bitcast ([128 x i64]* %i6000 to float*)
188 %r551 = load float* bitcast ([128 x i64]* @i6000 to float*)
191189 %r562 = sub i64 %s933, 0
192190 %r564 = icmp slt i64 %r512, 0
193191 br i1 %r564, label %b565, label %a45b
214212 a45b714:
215213 %r717 = add i64 %e944, 0
216214 %r720 = add i64 %r717, 0
217 %r721 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r720
215 %r721 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r720
218216 %r722 = load float* %r721
219217 %r726 = add i64 %r717, 0
220 %r727 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r726
218 %r727 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r726
221219 %r728 = load float* %r727
222220 %r732 = add i64 %r717, 0
223 %r733 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r732
221 %r733 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r732
224222 %r734 = load float* %r733
225223 %r738 = add i64 %r717, 0
226 %r739 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r738
224 %r739 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r738
227225 %r740 = load float* %r739
228226 %r744 = add i64 %r717, 0
229 %r745 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r744
227 %r745 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r744
230228 %r746 = load float* %r745
231229 %r750 = add i64 %r717, 0
232 %r751 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r750
230 %r751 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r750
233231 %r752 = load float* %r751
234232 %r753 = add float %r752, %r746
235233 %r754 = add float %r728, %r722
238236 %r757 = add float %r753, %r756
239237 %r759 = add float %r757, %r540
240238 %r770 = add i64 %r717, 0
241 %r771 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r770
239 %r771 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r770
242240 %r772 = load float* %r771
243241 %r776 = add i64 %r717, 0
244 %r777 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r776
242 %r777 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r776
245243 %r778 = load float* %r777
246244 %r781 = add float %r363, %r772
247245 %r782 = add float %r781, %r778
255253 %r844 = add i64 %r16, 0
256254 %r846 = sext i32 %r60 to i64
257255 %r847 = add i64 %r846, 0
258 %r851 = load float* bitcast ([128 x i64]* %i6000 to float*)
256 %r851 = load float* bitcast ([128 x i64]* @i6000 to float*)
259257 %r856 = sub i64 %r, 0
260258 br label %b858
261259 b858:
267265 %s1173 = add i64 %b1902, 0
268266 %r859 = add i64 %r856, 0
269267 %r862 = add i64 %w1891, 0
270 %r863 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r862
268 %r863 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r862
271269 %r864 = load float* %r863
272270 %r868 = add i64 %w1891, 0
273 %r869 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r868
271 %r869 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r868
274272 %r870 = load float* %r869
275273 %r873 = sub i64 %r859, 0
276274 %r876 = sub i64 %s1173, 0
337335 %d1353 = bitcast i64 %w1915 to i64
338336 %r1120 = add i64 %s661, 0
339337 %r1121 = add i64 %r1120, 0
340 %r1122 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r1121
338 %r1122 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r1121
341339 %r1123 = load float* %r1122
342340 %r1132 = bitcast i8* %c22012 to float*
343341 %r1134 = getelementptr float* %r1132, i64 %w1915
411409 %r1352 = add i64 %s1523, 0
412410 %r1355 = sub i64 %r1352, 0
413411 %r1370 = add i64 %d1533, 0
414 %r1371 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r1370
412 %r1371 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r1370
415413 %r1372 = load float* %r1371
416414 br label %a74b
417415 a74b:
445443 %r1756 = getelementptr float* %r1754, i64 %w1970
446444 %r1757 = load float* %r1756
447445 %r1761 = add i64 %r1622, 0
448 %r1762 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r1761
446 %r1762 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r1761
449447 %r1763 = load float* %r1762
450448 %r1767 = add i64 %r1622, 0
451 %r1768 = getelementptr float* bitcast ([128 x i64]* %i6000 to float*), i64 %r1767
449 %r1768 = getelementptr float* bitcast ([128 x i64]* @i6000 to float*), i64 %r1767
452450 %r1772 = add float %r1763, 0.000000e+00
453451 %r1773 = add float %r1772, 0.000000e+00
454452 %r1809 = add float %r1757, 0.000000e+00
0 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 &&
11 ; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | not getp test
22
3 define float %test1(float %a, float %b) {
4 %tmp = tail call float %copysignf( float %b, float %a )
3 define float @test1(float %a, float %b) {
4 %tmp = tail call float @copysignf( float %b, float %a )
55 ret float %tmp
66 }
77
8 define double %test2(double %a, float %b, float %c) {
8 define double @test2(double %a, float %b, float %c) {
99 %tmp1 = add float %b, %c
1010 %tmp2 = fpext float %tmp1 to double
11 %tmp = tail call double %copysign( double %a, double %tmp2 )
11 %tmp = tail call double @copysign( double %a, double %tmp2 )
1212 ret double %tmp
1313 }
1414
15 declare float %copysignf(float, float)
16 declare double %copysign(double, double)
15 declare float @copysignf(float, float)
16 declare double @copysign(double, double)
22 ; RUN: llvm-as < %s | llc -mtriple=i686-apple-darwin8.8.0 | grep ".private_extern" | wc -l | grep 2
33
44 %struct.Person = type { i32 }
5 %a = hidden global i32 0
6 %b = external global i32
5 @a = hidden global i32 0
6 @b = external global i32
77
88 implementation ; Functions:
99
10 define weak hidden void %_ZN6Person13privateMethodEv(%struct.Person* %this) {
10 define weak hidden void @_ZN6Person13privateMethodEv(%struct.Person* %this) {
1111 ret void
1212 }
1313
14 declare void %function(i32)
14 declare void @function(i32)
1515
16 define weak void %_ZN6PersonC1Ei(%struct.Person* %this, i32 %_c) {
16 define weak void @_ZN6PersonC1Ei(%struct.Person* %this, i32 %_c) {
1717 ret void
1818 }
1919
33 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOT | wc -l | grep 3 &&
44 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOTOFF | wc -l | grep 0
55
6 %ptr = external global i32*
7 %dst = external global i32
8 %src = external global i32
6 @ptr = external global i32*
7 @dst = external global i32
8 @src = external global i32
99
10 define void %foo() {
10 define void @foo() {
1111 entry:
12 store i32* %dst, i32** %ptr
13 %tmp.s = load i32* %src
14 store i32 %tmp.s, i32* %dst
12 store i32* @dst, i32** @ptr
13 %tmp.s = load i32* @src
14 store i32 %tmp.s, i32* @dst
1515 ret void
1616 }
1717
22 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
33 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOTOFF | wc -l | grep 4
44
5 %ptr = internal global i32* null
6 %dst = internal global i32 0
7 %src = internal global i32 0
5 @ptr = internal global i32* null
6 @dst = internal global i32 0
7 @src = internal global i32 0
88
9 define void %foo() {
9 define void @foo() {
1010 entry:
11 store i32* %dst, i32** %ptr
12 %tmp.s = load i32* %src
13 store i32 %tmp.s, i32* %dst
11 store i32* @dst, i32** @ptr
12 %tmp.s = load i32* @src
13 store i32 %tmp.s, i32* @dst
1414 ret void
1515 }
1616
22 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
33 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep PLT | wc -l | grep 1
44
5 define void %bar() {
5 define void @bar() {
66 entry:
7 call void(...)* %foo()
7 call void(...)* @foo()
88 br label %return
99 return:
1010 ret void
1111 }
1212
13 declare void %foo(...)
13 declare void @foo(...)
44 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep "GOT" | wc -l | grep 1 &&
55 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep "GOTOFF" | wc -l | grep 0
66
7 %pfoo = external global void(...)*
7 @pfoo = external global void(...)*
88
9 define void %bar() {
9 define void @bar() {
1010 entry:
11 %tmp = call void(...)*(...)* %afoo()
12 store void(...)* %tmp, void(...)** %pfoo
13 %tmp1 = load void(...)** %pfoo
11 %tmp = call void(...)*(...)* @afoo()
12 store void(...)* %tmp, void(...)** @pfoo
13 %tmp1 = load void(...)** @pfoo
1414 call void(...)* %tmp1()
1515 br label %return
1616 return:
1717 ret void
1818 }
1919
20 declare void(...)* %afoo(...)
20 declare void(...)* @afoo(...)
22 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
33 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep PLT | wc -l | grep 1
44
5 %ptr = external global i32*
5 @ptr = external global i32*
66
7 define void %foo() {
7 define void @foo() {
88 entry:
99 %ptr = malloc i32, i32 10
1010 ret void
22 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep piclabel | wc -l | grep 3 &&
33 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOT | wc -l | grep 3
44
5 %ptr = global i32* null
6 %dst = global i32 0
7 %src = global i32 0
5 @ptr = global i32* null
6 @dst = global i32 0
7 @src = global i32 0
88
9 define void %foo() {
9 define void @foo() {
1010 entry:
11 store i32* %dst, i32** %ptr
12 %tmp.s = load i32* %src
13 store i32 %tmp.s, i32* %dst
11 store i32* @dst, i32** @ptr
12 %tmp.s = load i32* @src
13 store i32 %tmp.s, i32* @dst
1414 ret void
1515 }
1616
33 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOTOFF | wc -l | grep 2 &&
44 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep CPI | wc -l | grep 4
55
6 define double %foo(i32 %a.u) {
6 define double @foo(i32 %a.u) {
77 entry:
88 %tmp = icmp eq i32 %a.u,0
99 %retval = select i1 %tmp, double 4.561230e+02, double 1.234560e+02
44 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep GOTOFF | wc -l | grep 1 &&
55 ; RUN: llvm-as < %s | llc -mtriple=i686-pc-linux-gnu -relocation-model=pic | grep JTI | wc -l | grep 15
66
7 define void %bar(i32 %n.u) {
7 define void @bar(i32 %n.u) {
88 entry:
99 switch i32 %n.u, label %bb12 [i32 1, label %bb i32 2, label %bb6 i32 4, label %bb7 i32 5, label %bb8 i32 6, label %bb10 i32 7, label %bb1 i32 8, label %bb3 i32 9, label %bb4 i32 10, label %bb9 i32 11, label %bb2 i32 12, label %bb5 i32 13, label %bb11 ]
1010 bb:
11 tail call void(...)* %foo1()
11 tail call void(...)* @foo1()
1212 ret void
1313 bb1:
14 tail call void(...)* %foo2()
14 tail call void(...)* @foo2()
1515 ret void
1616 bb2:
17 tail call void(...)* %foo6()
17 tail call void(...)* @foo6()
1818 ret void
1919 bb3:
20 tail call void(...)* %foo3()
20 tail call void(...)* @foo3()
2121 ret void
2222 bb4:
23 tail call void(...)* %foo4()
23 tail call void(...)* @foo4()
2424 ret void
2525 bb5:
26 tail call void(...)* %foo5()
26 tail call void(...)* @foo5()
2727 ret void
2828 bb6:
29 tail call void(...)* %foo1()
29 tail call void(...)* @foo1()
3030 ret void
3131 bb7:
32 tail call void(...)* %foo2()
32 tail call void(...)* @foo2()
3333 ret void
3434 bb8:
35 tail call void(...)* %foo6()
35 tail call void(...)* @foo6()
3636 ret void
3737 bb9:
38 tail call void(...)* %foo3()
38 tail call void(...)* @foo3()
3939 ret void
4040 bb10:
41 tail call void(...)* %foo4()
41 tail call void(...)* @foo4()
4242 ret void
4343 bb11:
44 tail call void(...)* %foo5()
44 tail call void(...)* @foo5()
4545 ret void
4646 bb12:
47 tail call void(...)* %foo6()
47 tail call void(...)* @foo6()
4848 ret void
4949 }
5050
51 declare void %foo1(...)
52 declare void %foo2(...)
53 declare void %foo6(...)
54 declare void %foo3(...)
55 declare void %foo4(...)
56 declare void %foo5(...)
51 declare void @foo1(...)
52 declare void @foo2(...)
53 declare void @foo6(...)
54 declare void @foo3(...)
55 declare void @foo4(...)
56 declare void @foo5(...)
44 ; RUN: llvm-as < %s | llc -march=x86 | grep '\(and\)\|\(test.*\$1\)' | \
55 ; RUN: wc -l | grep 6
66
7 define i1 %test1(i32 %X) zext {
7 define i1 @test1(i32 %X) zext {
88 %Y = trunc i32 %X to i1
99 ret i1 %Y
1010 }
1111
12 define i1 %test2(i32 %val, i32 %mask) {
12 define i1 @test2(i32 %val, i32 %mask) {
1313 entry:
1414 %mask = trunc i32 %mask to i8
1515 %shifted = ashr i32 %val, i8 %mask
2222 ret i1 false
2323 }
2424
25 define i32 %test3(i8* %ptr) {
25 define i32 @test3(i8* %ptr) {
2626 %val = load i8* %ptr
2727 %tmp = trunc i8 %val to i1
2828 br i1 %tmp, label %cond_true, label %cond_false
3232 ret i32 42
3333 }
3434
35 define i32 %test4(i8* %ptr) {
35 define i32 @test4(i8* %ptr) {
3636 %tmp = ptrtoint i8* %ptr to i1
3737 br i1 %tmp, label %cond_true, label %cond_false
3838 cond_true:
4141 ret i32 42
4242 }
4343
44 define i32 %test5(float %f) {
44 define i32 @test5(float %f) {
4545 %tmp = fptoui float %f to i1
4646 br i1 %tmp, label %cond_true, label %cond_false
4747 cond_true:
5050 ret i32 42
5151 }
5252
53 define i32 %test6(double %d) {
53 define i32 @test6(double %d) {
5454 %tmp = fptosi double %d to i1
5555 br i1 %tmp, label %cond_true, label %cond_false
5656 cond_true:
0 ; Test that redefinitions of globals produces an error in llvm-upgrade
11 ; RUN: llvm-upgrade < %s -o /dev/null -f 2>&1 | \
2 ; RUN: grep "Global variable '%B' was renamed to '"
2 ; RUN: grep "Renaming global variable 'B' to.*linkage errors"
33
44 %B = global int 7
55 %B = global int 7
33
44 ; Test forward references and redefinitions of globals
55
6 %B = global i32 7
7 %B = global i32 7
6 @B = global i32 7
7 @B = global i32 7
None ; RUN: llvm-upgrade < %s | llvm-as | llvm-dis > %t1.ll
0 ; RUN: llvm-as < %s | llvm-dis > %t1.ll
11 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
22 ; RUN: diff %t1.ll %t2.ll
33
4 void "NewCasts" (short %x) {
5 %a = zext short %x to int
6 %b = sext short %x to uint
7 %c = trunc short %x to ubyte
8 %d = uitofp short %x to float
9 %e = sitofp short %x to double
10 %f = fptoui float %d to short
11 %g = fptosi double %e to short
4 define void @"NewCasts" (i16 %x) {
5 %a = zext i16 %x to i32
6 %b = sext i16 %x to i32
7 %c = trunc i16 %x to i8
8 %d = uitofp i16 %x to float
9 %e = sitofp i16 %x to double
10 %f = fptoui float %d to i16
11 %g = fptosi double %e to i16
1212 %i = fpext float %d to double
1313 %j = fptrunc double %i to float
14 %k = bitcast int %a to float
15 %l = inttoptr short %x to int*
16 %m = ptrtoint int* %l to long
14 %k = bitcast i32 %a to float
15 %l = inttoptr i16 %x to i32*
16 %m = ptrtoint i32* %l to i64
1717 ret void
1818 }
1919
2020
21 ushort "ZExtConst" () {
22 ret ushort trunc ( uint zext ( short 42 to uint) to ushort )
21 define i16 @"ZExtConst" () {
22 ret i16 trunc ( i32 zext ( i16 42 to i32) to i16 )
2323 }
2424
25 short "SExtConst" () {
26 ret short trunc (int sext (ushort 42 to int) to short )
25 define i16 @"SExtConst" () {
26 ret i16 trunc (i32 sext (i16 42 to i32) to i16 )
2727 }
44 ; RUN: grep "<{" %t2.ll
55
66 %struct.anon = type <{ i8, i32, i32, i32 }>
7 %foos = external global %struct.anon
8 %bara = external global [2 x <{ i32, i8 }>]
7 @foos = external global %struct.anon
8 @bara = external global [2 x <{ i32, i8 }>]
99
1010 ;initializers should work for packed and non-packed the same way
11 %E1 = global <{i8, i32, i32}> <{i8 1, i32 2, i32 3}>
12 %E2 = global {i8, i32, i32} {i8 4, i32 5, i32 6}
11 @E1 = global <{i8, i32, i32}> <{i8 1, i32 2, i32 3}>
12 @E2 = global {i8, i32, i32} {i8 4, i32 5, i32 6}
1313
1414 implementation ; Functions:
1515
16 define i32 %main()
16 define i32 @main()
1717 {
18 %tmp = load i32* getelementptr (%struct.anon* %foos, i32 0, i32 1) ; [#uses=1]
19 %tmp3 = load i32* getelementptr (%struct.anon* %foos, i32 0, i32 2) ; [#uses=1]
20 %tmp6 = load i32* getelementptr (%struct.anon* %foos, i32 0, i32 3) ; [#uses=1]
18 %tmp = load i32* getelementptr (%struct.anon* @foos, i32 0, i32 1) ; [#uses=1]
19 %tmp3 = load i32* getelementptr (%struct.anon* @foos, i32 0, i32 2) ; [#uses=1]
20 %tmp6 = load i32* getelementptr (%struct.anon* @foos, i32 0, i32 3) ; [#uses=1]
2121 %tmp4 = add i32 %tmp3, %tmp ; [#uses=1]
2222 %tmp7 = add i32 %tmp4, %tmp6 ; [#uses=1]
2323 ret i32 %tmp7
2424 }
2525
26 define i32 %bar() {
26 define i32 @bar() {
2727 entry:
28 %tmp = load i32* getelementptr([2 x <{ i32, i8 }>]* %bara, i32 0, i32 0, i32 0 ) ; [#uses=1]
29 %tmp4 = load i32* getelementptr ([2 x <{ i32, i8 }>]* %bara, i32 0, i32 1, i32 0) ; [#uses=1]
28 %tmp = load i32* getelementptr([2 x <{ i32, i8 }>]* @bara, i32 0, i32 0, i32 0 ) ; [#uses=1]
29 %tmp4 = load i32* getelementptr ([2 x <{ i32, i8 }>]* @bara, i32 0, i32 1, i32 0) ; [#uses=1]
3030 %tmp5 = add i32 %tmp4, %tmp ; [#uses=1]
3131 ret i32 %tmp5
3232 }
44 %ZFunTy = type i32(i8 zext)
55 %SFunTy = type i32(i8 sext)
66
7 declare i16 "test"(i16 sext %arg) sext
8 declare i8 "test2" (i16 zext %a2) zext
7 declare i16 @"test"(i16 sext %arg) sext
8 declare i8 @"test2" (i16 zext %a2) zext
99
1010 implementation
1111
12 define i32 %main(i32 %argc, i8 **%argv) {
12 define i32 @main(i32 %argc, i8 **%argv) {
1313 %val = trunc i32 %argc to i16
14 %res = call i16 (i16 sext) sext *%test(i16 %val)
14 %res = call i16 (i16 sext) sext *@test(i16 %val)
1515 %two = add i16 %res, %res
16 %res = call i8 %test2(i16 %two zext) zext
16 %res = call i8 @test2(i16 %two zext) zext
1717 %retVal = sext i16 %two to i32
1818 ret i32 %retVal
1919 }
22 ; RUN: diff %t1.ll %t2.ll
33 ; RUN: llvm-as < %s | lli --force-interpreter=true | grep -- '-255'
44
5 %ARRAY = global [ 20 x i17 ] zeroinitializer
6 %FORMAT = constant [ 4 x i8 ] c"%d\0A\00"
5 @ARRAY = global [ 20 x i17 ] zeroinitializer
6 @FORMAT = constant [ 4 x i8 ] c"%d\0A\00"
77
8 declare i32 %printf(i8* %format, ...)
8 declare i32 @printf(i8* %format, ...)
99
10 define void %multiply(i32 %index, i32 %X, i32 %Y) {
10 define void @multiply(i32 %index, i32 %X, i32 %Y) {
1111 %Z = mul i32 %X, %Y
12 %P = getelementptr [20 x i17]* %ARRAY, i32 0, i32 %index
12 %P = getelementptr [20 x i17]* @ARRAY, i32 0, i32 %index
1313 %Result = trunc i32 %Z to i17
1414 store i17 %Result, i17* %P
1515 ret void
1616 }
1717
18 define i32 %main(i32 %argc, i8** %argc) {
18 define i32 @main(i32 %argc, i8** %argc) {
1919 %i = bitcast i32 0 to i32
20 call void %multiply(i32 %i, i32 -1, i32 255)
21 %P = getelementptr [20 x i17]* %ARRAY, i32 0, i32 0
20 call void @multiply(i32 %i, i32 -1, i32 255)
21 %P = getelementptr [20 x i17]* @ARRAY, i32 0, i32 0
2222 %X = load i17* %P
2323 %result = sext i17 %X to i32
24 %fmt = getelementptr [4 x i8]* %FORMAT, i32 0, i32 0
25 call i32 (i8*,...)* %printf(i8* %fmt, i32 %result)
24 %fmt = getelementptr [4 x i8]* @FORMAT, i32 0, i32 0
25 call i32 (i8*,...)* @printf(i8* %fmt, i32 %result)
2626 ret i32 %result
2727 }
2828
22 ; RUN: diff %t1.ll %t2.ll
33
44
5 declare void "foo"(i31 %i, i63 %j, i10 %k)
5 declare void @"foo"(i31 %i, i63 %j, i10 %k)
66
77 implementation
88
99 ; foo test basic arith operations
10 define void "foo"(i31 %i, i63 %j, i10 %k)
10 define void @"foo"(i31 %i, i63 %j, i10 %k)
1111 begin
1212 %t1 = trunc i63 %j to i31
1313 %t2 = add i31 %t1, %i
11 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
22 ; RUN: diff %t1.ll %t2.ll
33
4
5
6 declare void "foo"(i31 %i, i17 %j)
4 declare void @"foo"(i31 %i, i17 %j)
75
86 implementation
97
108 ; foo test basic bitwise operations
11 define void "foo"(i31 %i, i33 %j)
9 define void @"foo"(i31 %i, i33 %j)
1210 begin
1311 %t1 = trunc i33 %j to i31
1412 %t2 = and i31 %t1, %i
11 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
22 ; RUN: diff %t1.ll %t2.ll
33
4
5 declare void "foo"(i31 %i, i1280 %j, i1 %k, float %f)
4 declare void @"foo"(i31 %i, i1280 %j, i1 %k, float %f)
65
76 implementation
87
98 ; foo test basic arith operations
10 define void "foo"(i31 %i, i1280 %j, i1 %k, float %f)
9 define void @"foo"(i31 %i, i1280 %j, i1 %k, float %f)
1110 begin
1211 %t1 = trunc i1280 %j to i31
1312 %t2 = trunc i31 %t1 to i1
11 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
22 ; RUN: diff %t1.ll %t2.ll
33
4
5
64 implementation
75
8 define i55 "simpleIcmp"(i55 %i0, i55 %j0)
6 define i55 @"simpleIcmp"(i55 %i0, i55 %j0)
97 begin
108 %t1 = icmp eq i55 %i0, %j0
119 %t2 = icmp ne i55 %i0, %j0
2321 ret i55 %i0
2422 end
2523
26 define i31 "phitest"(i12 %i)
24 define i31 @"phitest"(i12 %i)
2725 begin
2826
2927 HasArg:
3634 br label %Continue
3735 end
3836
39 define i18 "select"(i18 %i)
37 define i18 @"select"(i18 %i)
4038 begin
4139 %t = icmp sgt i18 %i, 100
4240 %k = select i1 %t, i18 %i, i18 999
11 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
22 ; RUN: diff %t1.ll %t2.ll
33
4
5 declare void "foo"()
6
4 declare void @"foo"()
75
86 implementation
97
108 ; foo test basic arith operations
11 define void "foo"()
12 begin
9 define void @"foo"() {
1310 %t1 = malloc i31, i32 4
1411 %t2 = malloc i31, i32 7, align 1024
1512 %t3 = malloc [4 x i15]
16
1713
1814 %idx = getelementptr [4 x i15]* %t3, i64 0, i64 2
1915 store i15 -123, i15* %idx
3026
3127 free i31* %t5
3228 ret void
33 end
29 }
22 ; RUN: diff %t1.ll %t2.ll
33
44
5 %MyVar = external global i19
6 %MyIntList = external global { i39 *, i19 }
5 @MyVar = external global i19
6 @MyIntList = external global { i39 *, i19 }
77 external global i19 ; i19*:0
88
9 %AConst = constant i19 -123
9 @AConst = constant i19 -123
1010
11 %AString = constant [4 x i8] c"test"
11 @AString = constant [4 x i8] c"test"
1212
13 %ZeroInit = global { [100 x i19 ], [40 x float ] } { [100 x i19] zeroinitializer,
13 @ZeroInit = global { [100 x i19 ], [40 x float ] } { [100 x i19] zeroinitializer,
1414 [40 x float] zeroinitializer }
1515
1616 implementation
1717
18 define i19 "foo"(i19 %blah)
18 define i19 @"foo"(i19 %blah)
1919 begin
20 store i19 5, i19 *%MyVar
21 %idx = getelementptr { i39 *, i19 } * %MyIntList, i64 0, i32 1
20 store i19 5, i19* @MyVar
21 %idx = getelementptr { i39 *, i19 } * @MyIntList, i64 0, i32 1
2222 store i19 12, i19* %idx
2323 ret i19 %blah
2424 end
11 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
22 ; RUN: diff %t1.ll %t2.ll
33
4
5 %foo1 = external global <4 x float>;
6 %foo2 = external global <2 x i10>;
4 @foo1 = external global <4 x float>;
5 @foo2 = external global <2 x i10>;
76
87 implementation ; Functions:
98
10 define void %main()
9 define void @main()
1110 {
12 store <4 x float> , <4 x float>* %foo1
13 store <2 x i10> , <2 x i10>* %foo2
14 %l1 = load <4 x float>* %foo1
15 %l2 = load <2 x i10>* %foo2
11 store <4 x float> , <4 x float>* @foo1
12 store <2 x i10> , <2 x i10>* @foo2
13 %l1 = load <4 x float>* @foo1
14 %l2 = load <2 x i10>* @foo2
1615 %r1 = extractelement <2 x i10> %l2, i32 1
1716 %r2 = extractelement <2 x i10> %l2, i32 0
1817 %t = mul i10 %r1, %r2
1918 %r3 = insertelement <2 x i10> %l2, i10 %t, i32 0
20 store <2 x i10> %r3, <2 x i10>* %foo2
19 store <2 x i10> %r3, <2 x i10>* @foo2
2120 ret void
2221 }
22
33 ; test 1 bit
44 ;
5 %b = constant i1 add(i1 1 , i1 1)
6 %c = constant i1 add(i1 -1, i1 1)
7 %d = constant i1 add(i1 -1, i1 -1)
8 %e = constant i1 sub(i1 -1, i1 1)
9 %f = constant i1 sub(i1 1 , i1 -1)
10 %g = constant i1 sub(i1 1 , i1 1)
5 @b = constant i1 add(i1 1 , i1 1)
6 @c = constant i1 add(i1 -1, i1 1)
7 @d = constant i1 add(i1 -1, i1 -1)
8 @e = constant i1 sub(i1 -1, i1 1)
9 @f = constant i1 sub(i1 1 , i1 -1)
10 @g = constant i1 sub(i1 1 , i1 1)
1111
12 %h = constant i1 shl(i1 1 , i8 1)
13 %i = constant i1 shl(i1 1 , i8 0)
14 %j = constant i1 lshr(i1 1, i8 1)
15 %m = constant i1 ashr(i1 1, i8 1)
12 @h = constant i1 shl(i1 1 , i8 1)
13 @i = constant i1 shl(i1 1 , i8 0)
14 @j = constant i1 lshr(i1 1, i8 1)
15 @m = constant i1 ashr(i1 1, i8 1)
1616
17 %n = constant i1 mul(i1 -1, i1 1)
18 %o = constant i1 sdiv(i1 -1, i1 1)
19 %p = constant i1 sdiv(i1 1 , i1 -1)
20 %q = constant i1 udiv(i1 -1, i1 1)
21 %r = constant i1 udiv(i1 1, i1 -1)
22 %s = constant i1 srem(i1 -1, i1 1)
23 %t = constant i1 urem(i1 -1, i1 1)
17 @n = constant i1 mul(i1 -1, i1 1)
18 @o = constant i1 sdiv(i1 -1, i1 1)
19 @p = constant i1 sdiv(i1 1 , i1 -1)
20 @q = constant i1 udiv(i1 -1, i1 1)
21 @r = constant i1 udiv(i1 1, i1 -1)
22 @s = constant i1 srem(i1 -1, i1 1)
23 @t = constant i1 urem(i1 -1, i1 1)
0 ; ModuleID = ''
1 %b = constant i1 false ; [#uses=0]
2 %c = constant i1 false ; [#uses=0]
3 %d = constant i1 false ; [#uses=0]
4 %e = constant i1 false ; [#uses=0]
5 %f = constant i1 false ; [#uses=0]
6 %g = constant i1 false ; [#uses=0]
7 %h = constant i1 false ; [#uses=0]
8 %i = constant i1 true ; [#uses=0]
9 %j = constant i1 false ; [#uses=0]
10 %m = constant i1 true ; [#uses=0]
11 %n = constant i1 true ; [#uses=0]
12 %o = constant i1 true ; [#uses=0]
13 %p = constant i1 true ; [#uses=0]
14 %q = constant i1 true ; [#uses=0]
15 %r = constant i1 true ; [#uses=0]
16 %s = constant i1 false ; [#uses=0]
17 %t = constant i1 false ; [#uses=0]
1 @b = constant i1 false ; [#uses=0]
2 @c = constant i1 false ; [#uses=0]
3 @d = constant i1 false ; [#uses=0]
4 @e = constant i1 false ; [#uses=0]
5 @f = constant i1 false ; [#uses=0]
6 @g = constant i1 false ; [#uses=0]
7 @h = constant i1 false ; [#uses=0]
8 @i = constant i1 true ; [#uses=0]
9 @j = constant i1 false ; [#uses=0]
10 @m = constant i1 true ; [#uses=0]
11 @n = constant i1 true ; [#uses=0]
12 @o = constant i1 true ; [#uses=0]
13 @p = constant i1 true ; [#uses=0]
14 @q = constant i1 true ; [#uses=0]
15 @r = constant i1 true ; [#uses=0]
16 @s = constant i1 false ; [#uses=0]
17 @t = constant i1 false ; [#uses=0]
1818
1919 implementation ; Functions:
22
33 ; test 15 bits
44 ;
5 %b = constant i15 add(i15 32767, i15 1)
6 %c = constant i15 add(i15 32767, i15 32767)
7 %d = constant i15 add(i15 32760, i15 8)
8 %e = constant i15 sub(i15 0 , i15 1)
9 %f = constant i15 sub(i15 0 , i15 32767)
10 %g = constant i15 sub(i15 2 , i15 32767)
5 @b = constant i15 add(i15 32767, i15 1)
6 @c = constant i15 add(i15 32767, i15 32767)
7 @d = constant i15 add(i15 32760, i15 8)
8 @e = constant i15 sub(i15 0 , i15 1)
9 @f = constant i15 sub(i15 0 , i15 32767)
10 @g = constant i15 sub(i15 2 , i15 32767)
1111
12 %h = constant i15 shl(i15 1 , i8 15)
13 %i = constant i15 shl(i15 1 , i8 14)
14 %j = constant i15 lshr(i15 32767 , i8 14)
15 %k = constant i15 lshr(i15 32767 , i8 15)
16 %l = constant i15 ashr(i15 32767 , i8 14)
17 %m = constant i15 ashr(i15 32767 , i8 15)
12 @h = constant i15 shl(i15 1 , i8 15)
13 @i = constant i15 shl(i15 1 , i8 14)
14 @j = constant i15 lshr(i15 32767 , i8 14)
15 @k = constant i15 lshr(i15 32767 , i8 15)
16 @l = constant i15 ashr(i15 32767 , i8 14)
17 @m = constant i15 ashr(i15 32767 , i8 15)
1818
19 %n = constant i15 mul(i15 32767, i15 2)
20 %q = constant i15 mul(i15 -16383,i15 -3)
21 %r = constant i15 sdiv(i15 -1, i15 16383)
22 %s = constant i15 udiv(i15 -1, i15 16383)
23 %t = constant i15 srem(i15 1, i15 32766)
24 %u = constant i15 urem(i15 32767,i15 -1)
25 %o = constant i15 trunc( i16 32768 to i15 )
26 %p = constant i15 trunc( i16 32767 to i15 )
19 @n = constant i15 mul(i15 32767, i15 2)
20 @q = constant i15 mul(i15 -16383,i15 -3)
21 @r = constant i15 sdiv(i15 -1, i15 16383)
22 @s = constant i15 udiv(i15 -1, i15 16383)
23 @t = constant i15 srem(i15 1, i15 32766)
24 @u = constant i15 urem(i15 32767,i15 -1)
25 @o = constant i15 trunc( i16 32768 to i15 )
26 @p = constant i15 trunc( i16 32767 to i15 )
2727
0 ; ModuleID = ''
1 %b = constant i15 0 ; [#uses=0]
2 %c = constant i15 -2 ; [#uses=0]
3 %d = constant i15 0 ; [#uses=0]
4 %e = constant i15 -1 ; [#uses=0]
5 %f = constant i15 1 ; [#uses=0]
6 %g = constant i15 3 ; [#uses=0]
7 %h = constant i15 0 ; [#uses=0]
8 %i = constant i15 -16384 ; [#uses=0]
9 %j = constant i15 1 ; [#uses=0]
10 %k = constant i15 0 ; [#uses=0]
11 %l = constant i15 -1 ; [#uses=0]
12 %m = constant i15 -1 ; [#uses=0]
13 %n = constant i15 -2 ; [#uses=0]
14 %q = constant i15 16381 ; [#uses=0]
15 %r = constant i15 0 ; [#uses=0]
16 %s = constant i15 2 ; [#uses=0]
17 %t = constant i15 1 ; [#uses=0]
18 %u = constant i15 0 ; [#uses=0]
19 %o = constant i15 0 ; [#uses=0]
20 %p = constant i15 -1 ; [#uses=0]
1 @b = constant i15 0 ; [#uses=0]
2 @c = constant i15 -2 ; [#uses=0]
3 @d = constant i15 0 ; [#uses=0]
4 @e = constant i15 -1 ; [#uses=0]
5 @f = constant i15 1 ; [#uses=0]
6 @g = constant i15 3 ; [#uses=0]
7 @h = constant i15 0 ; [#uses=0]
8 @i = constant i15 -16384 ; [#uses=0]
9 @j = constant i15 1 ; [#uses=0]
10 @k = constant i15 0 ; [#uses=0]
11 @l = constant i15 -1 ; [#uses=0]
12 @m = constant i15 -1 ; [#uses=0]
13 @n = constant i15 -2 ; [#uses=0]
14 @q = constant i15 16381 ; [#uses=0]
15 @r = constant i15 0 ; [#uses=0]
16 @s = constant i15 2 ; [#uses=0]
17 @t = constant i15 1 ; [#uses=0]
18 @u = constant i15 0 ; [#uses=0]
19 @o = constant i15 0 ; [#uses=0]
20 @p = constant i15 -1 ; [#uses=0]
2121
2222 implementation ; Functions:
22
33 ; test 17 bits
44 ;
5 %b = constant i17 add(i17 131071, i17 1)
6 %c = constant i17 add(i17 131071, i17 131071)
7 %d = constant i17 add(i17 131064, i17 8)
8 %e = constant i17 sub(i17 0 , i17 1)
9 %f = constant i17 sub(i17 0 , i17 131071)
10 %g = constant i17 sub(i17 2 , i17 131071)
5 @b = constant i17 add(i17 131071, i17 1)
6 @c = constant i17 add(i17 131071, i17 131071)
7 @d = constant i17 add(i17 131064, i17 8)
8 @e = constant i17 sub(i17 0 , i17 1)
9 @f = constant i17 sub(i17 0 , i17 131071)
10 @g = constant i17 sub(i17 2 , i17 131071)
1111
12 %h = constant i17 shl(i17 1 , i8 17)
13 %i = constant i17 shl(i17 1 , i8 16)
14 %j = constant i17 lshr(i17 131071 , i8 16)
15 %k = constant i17 lshr(i17 131071 , i8 17)
16 %l = constant i17 ashr(i17 131071 , i8 16)
17 %m = constant i17 ashr(i17 131071 , i8 17)
12 @h = constant i17 shl(i17 1 , i8 17)
13 @i = constant i17 shl(i17 1 , i8 16)
14 @j = constant i17 lshr(i17 131071 , i8 16)
15 @k = constant i17 lshr(i17 131071 , i8 17)
16 @l = constant i17 ashr(i17 131071 , i8 16)
17 @m = constant i17 ashr(i17 131071 , i8 17)
1818
19 %n = constant i17 mul(i17 131071, i17 2)
20 %q = constant i17 sdiv(i17 -1, i17 65535)
21 %r = constant i17 udiv(i17 -1, i17 65535)
22 %s = constant i17 srem(i17 1, i17 131070)
23 %t = constant i17 urem(i17 131071,i17 -1)
24 %o = constant i17 trunc( i18 131072 to i17 )
25 %p = constant i17 trunc( i18 131071 to i17 )
19 @n = constant i17 mul(i17 131071, i17 2)
20 @q = constant i17 sdiv(i17 -1, i17 65535)
21 @r = constant i17 udiv(i17 -1, i17 65535)
22 @s = constant i17 srem(i17 1, i17 131070)
23 @t = constant i17 urem(i17 131071,i17 -1)
24 @o = constant i17 trunc( i18 131072 to i17 )
25 @p = constant i17 trunc( i18 131071 to i17 )
0 ; ModuleID = ''
1 %b = constant i17 0 ; [#uses=0]
2 %c = constant i17 -2 ; [#uses=0]
3 %d = constant i17 0 ; [#uses=0]
4 %e = constant i17 -1 ; [#uses=0]
5 %f = constant i17 1 ; [#uses=0]
6 %g = constant i17 3 ; [#uses=0]
7 %h = constant i17 0 ; [#uses=0]
8 %i = constant i17 -65536 ; [#uses=0]
9 %j = constant i17 1 ; [#uses=0]
10 %k = constant i17 0 ; [#uses=0]
11 %l = constant i17 -1 ; [#uses=0]
12 %m = constant i17 -1 ; [#uses=0]
13 %n = constant i17 -2 ; [#uses=0]
14 %q = constant i17 0 ; [#uses=0]
15 %r = constant i17 2 ; [#uses=0]
16 %s = constant i17 1 ; [#uses=0]
17 %t = constant i17 0 ; [#uses=0]
18 %o = constant i17 0 ; [#uses=0]
19 %p = constant i17 -1 ; [#uses=0]
1 @b = constant i17 0 ; [#uses=0]
2 @c = constant i17 -2 ; [#uses=0]
3 @d = constant i17 0 ; [#uses=0]
4 @e = constant i17 -1 ; [#uses=0]
5 @f = constant i17 1 ; [#uses=0]
6 @g = constant i17 3 ; [#uses=0]
7 @h = constant i17 0 ; [#uses=0]
8 @i = constant i17 -65536 ; [#uses=0]
9 @j = constant i17 1 ; [#uses=0]
10 @k = constant i17 0 ; [#uses=0]
11 @l = constant i17 -1 ; [#uses=0]
12 @m = constant i17 -1 ; [#uses=0]
13 @n = constant i17 -2 ; [#uses=0]
14 @q = constant i17 0 ; [#uses=0]
15 @r = constant i17 2 ; [#uses=0]
16 @s = constant i17 1 ; [#uses=0]
17 @t = constant i17 0 ; [#uses=0]
18 @o = constant i17 0 ; [#uses=0]
19 @p = constant i17 -1 ; [#uses=0]
2020
2121 implementation ; Functions:
22
33 ; test 31 bits
44 ;
5 %b = constant i31 add(i31 2147483647, i31 1)
6 %c = constant i31 add(i31 2147483647, i31 2147483647)
7 %d = constant i31 add(i31 2147483640, i31 8)
8 %e = constant i31 sub(i31 0 , i31 1)
9 %f = constant i31 sub(i31 0 , i31 2147483647)
10 %g = constant i31 sub(i31 2 , i31 2147483647)
5 @b = constant i31 add(i31 2147483647, i31 1)
6 @c = constant i31 add(i31 2147483647, i31 2147483647)
7 @d = constant i31 add(i31 2147483640, i31 8)
8 @e = constant i31 sub(i31 0 , i31 1)
9 @f = constant i31 sub(i31 0 , i31 2147483647)
10 @g = constant i31 sub(i31 2 , i31 2147483647)
1111
12 %h = constant i31 shl(i31 1 , i8 31)
13 %i = constant i31 shl(i31 1 , i8 30)
14 %j = constant i31 lshr(i31 2147483647 , i8 30)
15 %k = constant i31 lshr(i31 2147483647 , i8 31)
16 %l = constant i31 ashr(i31 2147483647 , i8 30)
17 %m = constant i31 ashr(i31 2147483647 , i8 31)
12 @h = constant i31 shl(i31 1 , i8 31)
13 @i = constant i31 shl(i31 1 , i8 30)
14 @j = constant i31 lshr(i31 2147483647 , i8 30)
15 @k = constant i31 lshr(i31 2147483647 , i8 31)
16 @l = constant i31 ashr(i31 2147483647 , i8 30)
17 @m = constant i31 ashr(i31 2147483647 , i8 31)
1818
19 %n = constant i31 mul(i31 2147483647, i31 2)
20 %q = constant i31 sdiv(i31 -1, i31 1073741823)
21 %r = constant i31 udiv(i31 -1, i31 1073741823)
22 %s = constant i31 srem(i31 3, i31 2147483646)
23 %t = constant i31 urem(i31 2147483647,i31 -1)
24 %o = constant i31 trunc( i32 2147483648 to i31 )
25 %p = constant i31 trunc( i32 2147483647 to i31 )
19 @n = constant i31 mul(i31 2147483647, i31 2)
20 @q = constant i31 sdiv(i31 -1, i31 1073741823)
21 @r = constant i31 udiv(i31 -1, i31 1073741823)
22 @s = constant i31 srem(i31 3, i31 2147483646)
23 @t = constant i31 urem(i31 2147483647,i31 -1)
24 @o = constant i31 trunc( i32 2147483648 to i31 )
25 @p = constant i31 trunc( i32 2147483647 to i31 )
0 ; ModuleID = ''
1 %b = constant i31 0 ; [#uses=0]
2 %c = constant i31 -2 ; [#uses=0]
3 %d = constant i31 0 ; [#uses=0]
4 %e = constant i31 -1 ; [#uses=0]
5 %f = constant i31 1 ; [#uses=0]
6 %g = constant i31 3 ; [#uses=0]
7 %h = constant i31 0 ; [#uses=0]
8 %i = constant i31 -1073741824 ; [#uses=0]
9 %j = constant i31 1 ; [#uses=0]
10 %k = constant i31 0 ; [#uses=0]
11 %l = constant i31 -1 ; [#uses=0]
12 %m = constant i31 -1 ; [#uses=0]
13 %n = constant i31 -2 ; [#uses=0]
14 %q = constant i31 0 ; [#uses=0]
15 %r = constant i31 2 ; [#uses=0]
16 %s = constant i31 1 ; [#uses=0]
17 %t = constant i31 0 ; [#uses=0]
18 %o = constant i31 0 ; [#uses=0]
19 %p = constant i31 -1 ; [#uses=0]
1 @b = constant i31 0 ; [#uses=0]
2 @c = constant i31 -2 ; [#uses=0]
3 @d = constant i31 0 ; [#uses=0]
4 @e = constant i31 -1 ; [#uses=0]
5 @f = constant i31 1 ; [#uses=0]
6 @g = constant i31 3 ; [#uses=0]
7 @h = constant i31 0 ; [#uses=0]
8 @i = constant i31 -1073741824 ; [#uses=0]
9 @j = constant i31 1 ; [#uses=0]
10 @k = constant i31 0 ; [#uses=0]
11 @l = constant i31 -1 ; [#uses=0]
12 @m = constant i31 -1 ; [#uses=0]
13 @n = constant i31 -2 ; [#uses=0]
14 @q = constant i31 0 ; [#uses=0]
15 @r = constant i31 2 ; [#uses=0]
16 @s = constant i31 1 ; [#uses=0]
17 @t = constant i31 0 ; [#uses=0]
18 @o = constant i31 0 ; [#uses=0]
19 @p = constant i31 -1 ; [#uses=0]
2020
2121 implementation ; Functions:
22
33 ; test 33 bits
44 ;
5 %b = constant i33 add(i33 8589934591, i33 1)
6 %c = constant i33 add(i33 8589934591, i33 8589934591)
7 %d = constant i33 add(i33 8589934584, i33 8)
8 %e = constant i33 sub(i33 0 , i33 1)
9 %f = constant i33 sub(i33 0 , i33 8589934591)
10 %g = constant i33 sub(i33 2 , i33 8589934591)
5 @b = constant i33 add(i33 8589934591, i33 1)
6 @c = constant i33 add(i33 8589934591, i33 8589934591)
7 @d = constant i33 add(i33 8589934584, i33 8)
8 @e = constant i33 sub(i33 0 , i33 1)
9 @f = constant i33 sub(i33 0 , i33 8589934591)
10 @g = constant i33 sub(i33 2 , i33 8589934591)
1111
12 %h = constant i33 shl(i33 1 , i8 33)
13 %i = constant i33 shl(i33 1 , i8 32)
14 %j = constant i33 lshr(i33 8589934591 , i8 32)
15 %k = constant i33 lshr(i33 8589934591 , i8 33)
16 %l = constant i33 ashr(i33 8589934591 , i8 32)
17 %m = constant i33 ashr(i33 8589934591 , i8 33)
12 @h = constant i33 shl(i33 1 , i8 33)
13 @i = constant i33 shl(i33 1 , i8 32)
14 @j = constant i33 lshr(i33 8589934591 , i8 32)
15 @k = constant i33 lshr(i33 8589934591 , i8 33)
16 @l = constant i33 ashr(i33 8589934591 , i8 32)
17 @m = constant i33 ashr(i33 8589934591 , i8 33)
1818
19 %n = constant i33 mul(i33 8589934591, i33 2)
20 %q = constant i33 sdiv(i33 -1, i33 4294967295)
21 %r = constant i33 udiv(i33 -1, i33 4294967295)
22 %s = constant i33 srem(i33 3, i33 8589934590)
23 %t = constant i33 urem(i33 8589934591,i33 -1)
24 %o = constant i33 trunc( i34 8589934592 to i33 )
25 %p = constant i33 trunc( i34 8589934591 to i33 )
19 @n = constant i33 mul(i33 8589934591, i33 2)
20 @q = constant i33 sdiv(i33 -1, i33 4294967295)
21 @r = constant i33 udiv(i33 -1, i33 4294967295)
22 @s = constant i33 srem(i33 3, i33 8589934590)
23 @t = constant i33 urem(i33 8589934591,i33 -1)
24 @o = constant i33 trunc( i34 8589934592 to i33 )
25 @p = constant i33 trunc( i34 8589934591 to i33 )
2626
0 ; ModuleID = ''
1 %b = constant i33 0 ; [#uses=0]
2 %c = constant i33 -2 ; [#uses=0]
3 %d = constant i33 0 ; [#uses=0]
4 %e = constant i33 -1 ; [#uses=0]
5 %f = constant i33 1 ; [#uses=0]
6 %g = constant i33 3 ; [#uses=0]
7 %h = constant i33 0 ; [#uses=0]
8 %i = constant i33 -4294967296 ; [#uses=0]
9 %j = constant i33 1 ; [#uses=0]
10 %k = constant i33 0 ; [#uses=0]
11 %l = constant i33 -1 ; [#uses=0]
12 %m = constant i33 -1 ; [#uses=0]
13 %n = constant i33 -2 ; [#uses=0]
14 %q = constant i33 0 ; [#uses=0]
15 %r = constant i33 2 ; [#uses=0]
16 %s = constant i33 1 ; [#uses=0]
17 %t = constant i33 0 ; [#uses=0]
18 %o = constant i33 0 ; [#uses=0]
19 %p = constant i33 -1 ; [#uses=0]
1 @b = constant i33 0 ; [#uses=0]
2 @c = constant i33 -2 ; [#uses=0]
3 @d = constant i33 0 ; [#uses=0]
4 @e = constant i33 -1 ; [#uses=0]
5 @f = constant i33 1 ; [#uses=0]
6 @g = constant i33 3 ; [#uses=0]
7 @h = constant i33 0 ; [#uses=0]
8 @i = constant i33 -4294967296 ; [#uses=0]
9 @j = constant i33 1 ; [#uses=0]
10 @k = constant i33 0 ; [#uses=0]
11 @l = constant i33 -1 ; [#uses=0]
12 @m = constant i33 -1 ; [#uses=0]
13 @n = constant i33 -2 ; [#uses=0]
14 @q = constant i33 0 ; [#uses=0]
15 @r = constant i33 2 ; [#uses=0]
16 @s = constant i33 1 ; [#uses=0]
17 @t = constant i33 0 ; [#uses=0]
18 @o = constant i33 0 ; [#uses=0]
19 @p = constant i33 -1 ; [#uses=0]
2020
2121 implementation ; Functions:
22
33 ; test 63 bits
44 ;
5 %b = constant i63 add(i63 9223372036854775807, i63 1)
6 %c = constant i63 add(i63 9223372036854775807, i63 9223372036854775807)
7 %d = constant i63 add(i63 9223372036854775800, i63 8)
8 %e = constant i63 sub(i63 0 , i63 1)
9 %f = constant i63 sub(i63 0 , i63 9223372036854775807)
10 %g = constant i63 sub(i63 2 , i63 9223372036854775807)
5 @b = constant i63 add(i63 9223372036854775807, i63 1)
6 @c = constant i63 add(i63 9223372036854775807, i63 9223372036854775807)
7 @d = constant i63 add(i63 9223372036854775800, i63 8)
8 @e = constant i63 sub(i63 0 , i63 1)
9 @f = constant i63 sub(i63 0 , i63 9223372036854775807)
10 @g = constant i63 sub(i63 2 , i63 9223372036854775807)
1111
12 %h = constant i63 shl(i63 1 , i8 63)
13 %i = constant i63 shl(i63 1 , i8 62)
14 %j = constant i63 lshr(i63 9223372036854775807 , i8 62)
15 %k = constant i63 lshr(i63 9223372036854775807 , i8 63)
16 %l = constant i63 ashr(i63 9223372036854775807 , i8 62)
17 %m = constant i63 ashr(i63 9223372036854775807 , i8 63)
12 @h = constant i63 shl(i63 1 , i8 63)
13 @i = constant i63 shl(i63 1 , i8 62)
14 @j = constant i63 lshr(i63 9223372036854775807 , i8 62)
15 @k = constant i63 lshr(i63 9223372036854775807 , i8 63)
16 @l = constant i63 ashr(i63 9223372036854775807 , i8 62)
17 @m = constant i63 ashr(i63 9223372036854775807 , i8 63)
1818
19 %n = constant i63 mul(i63 9223372036854775807, i63 2)
20 %q = constant i63 sdiv(i63 -1, i63 4611686018427387903)
21 %u = constant i63 sdiv(i63 -1, i63 1)
22 %r = constant i63 udiv(i63 -1, i63 4611686018427387903)
23 %s = constant i63 srem(i63 3, i63 9223372036854775806)
24 %t = constant i63 urem(i63 9223372036854775807,i63 -1)
25 %o = constant i63 trunc( i64 9223372036854775808 to i63 )
26 %p = constant i63 trunc( i64 9223372036854775807 to i63 )
19 @n = constant i63 mul(i63 9223372036854775807, i63 2)
20 @q = constant i63 sdiv(i63 -1, i63 4611686018427387903)
21 @u = constant i63 sdiv(i63 -1, i63 1)
22 @r = constant i63 udiv(i63 -1, i63 4611686018427387903)
23 @s = constant i63 srem(i63 3, i63 9223372036854775806)
24 @t = constant i63 urem(i63 9223372036854775807,i63 -1)
25 @o = constant i63 trunc( i64 9223372036854775808 to i63 )
26 @p = constant i63 trunc( i64 9223372036854775807 to i63 )
0 ; ModuleID = ''
1 %b = constant i63 0 ; [#uses=0]
2 %c = constant i63 -2 ; [#uses=0]
3 %d = constant i63 0 ; [#uses=0]
4 %e = constant i63 -1 ; [#uses=0]
5 %f = constant i63 1 ; [#uses=0]
6 %g = constant i63 3 ; [#uses=0]
7 %h = constant i63 0 ; [#uses=0]
8 %i = constant i63 -4611686018427387904 ; [#uses=0]
9 %j = constant i63 1 ; [#uses=0]
10 %k = constant i63 0 ; [#uses=0]
11 %l = constant i63 -1 ; [#uses=0]
12 %m = constant i63 -1 ; [#uses=0]
13 %n = constant i63 -2 ; [#uses=0]
14 %q = constant i63 0 ; [#uses=0]
15 %u = constant i63 -1 ; [#uses=0]
16 %r = constant i63 2 ; [#uses=0]
17 %s = constant i63 1 ; [#uses=0]
18 %t = constant i63 0 ; [#uses=0]
19 %o = constant i63 0 ; [#uses=0]
20 %p = constant i63 -1 ; [#uses=0]
1 @b = constant i63 0 ; [#uses=0]
2 @c = constant i63 -2 ; [#uses=0]
3 @d = constant i63 0 ; [#uses=0]
4 @e = constant i63 -1 ; [#uses=0]
5 @f = constant i63 1 ; [#uses=0]
6 @g = constant i63 3 ; [#uses=0]
7 @h = constant i63 0 ; [#uses=0]
8 @i = constant i63 -4611686018427387904 ; [#uses=0]
9 @j = constant i63 1 ; [#uses=0]
10 @k = constant i63 0 ; [#uses=0]
11 @l = constant i63 -1 ; [#uses=0]
12 @m = constant i63 -1 ; [#uses=0]
13 @n = constant i63 -2 ; [#uses=0]
14 @q = constant i63 0 ; [#uses=0]
15 @u = constant i63 -1 ; [#uses=0]
16 @r = constant i63 2 ; [#uses=0]
17 @s = constant i63 1 ; [#uses=0]
18 @t = constant i63 0 ; [#uses=0]
19 @o = constant i63 0 ; [#uses=0]
20 @p = constant i63 -1 ; [#uses=0]
2121
2222 implementation ; Functions:
22
33 ; test 7 bits
44 ;
5 %b = constant i7 add(i7 127, i7 1)
6 %q = constant i7 add(i7 -64, i7 -1)
7 %c = constant i7 add(i7 127, i7 127)
8 %d = constant i7 add(i7 120, i7 8)
9 %e = constant i7 sub(i7 0 , i7 1)
10 %f = constant i7 sub(i7 0 , i7 127)
11 %g = constant i7 sub(i7 2 , i7 127)
12 %r = constant i7 sub(i7 -3, i7 120)
13 %s = constant i7 sub(i7 -3, i7 -8)
5 @b = constant i7 add(i7 127, i7 1)
6 @q = constant i7 add(i7 -64, i7 -1)
7 @c = constant i7 add(i7 127, i7 127)
8 @d = constant i7 add(i7 120, i7 8)
9 @e = constant i7 sub(i7 0 , i7 1)
10 @f = constant i7 sub(i7 0 , i7 127)
11 @g = constant i7 sub(i7 2 , i7 127)
12 @r = constant i7 sub(i7 -3, i7 120)
13 @s = constant i7 sub(i7 -3, i7 -8)
1414
15 %h = constant i7 shl(i7 1 , i8 7)
16 %i = constant i7 shl(i7 1 , i8 6)
17 %j = constant i7 lshr(i7 127 , i8 6)
18 %k = constant i7 lshr(i7 127 , i8 7)
19 %l = constant i7 ashr(i7 127 , i8 6)
20 %m = constant i7 ashr(i7 127 , i8 7)
21 %m2= constant i7 ashr(i7 -1 , i8 3)
15 @h = constant i7 shl(i7 1 , i8 7)
16 @i = constant i7 shl(i7 1 , i8 6)
17 @j = constant i7 lshr(i7 127 , i8 6)
18 @k = constant i7 lshr(i7 127 , i8 7)
19 @l = constant i7 ashr(i7 127 , i8 6)
20 @m = constant i7 ashr(i7 127 , i8 7)
21 @m2= constant i7 ashr(i7 -1 , i8 3)
2222
23 %n = constant i7 mul(i7 127, i7 2)
24 %t = constant i7 mul(i7 -63, i7 -2)
25 %u = constant i7 mul(i7 -32, i7 2)
26 %v = constant i7 sdiv(i7 -1, i7 63)
27 %w = constant i7 udiv(i7 -1, i7 63)
28 %x = constant i7 srem(i7 1 , i7 126)
29 %y = constant i7 urem(i7 127, i7 -1)
30 %o = constant i7 trunc( i8 128 to i7 )
31 %p = constant i7 trunc( i8 255 to i7 )
23 @n = constant i7 mul(i7 127, i7 2)
24 @t = constant i7 mul(i7 -63, i7 -2)
25 @u = constant i7 mul(i7 -32, i7 2)
26 @v = constant i7 sdiv(i7 -1, i7 63)
27 @w = constant i7 udiv(i7 -1, i7 63)
28 @x = constant i7 srem(i7 1 , i7 126)
29 @y = constant i7 urem(i7 127, i7 -1)
30 @o = constant i7 trunc( i8 128 to i7 )
31 @p = constant i7 trunc( i8 255 to i7 )
3232
0 ; ModuleID = ''
1 %b = constant i7 0 ; [#uses=0]
2 %q = constant i7 63 ; [#uses=0]
3 %c = constant i7 -2 ; [#uses=0]
4 %d = constant i7 0 ; [#uses=0]
5 %e = constant i7 -1 ; [#uses=0]
6 %f = constant i7 1 ; [#uses=0]
7 %g = constant i7 3 ; [#uses=0]
8 %r = constant i7 5 ; [#uses=0]
9 %s = constant i7 5 ; [#uses=0]
10 %h = constant i7 0 ; [#uses=0]
11 %i = constant i7 -64 ; [#uses=0]
12 %j = constant i7 1 ; [#uses=0]
13 %k = constant i7 0 ; [#uses=0]
14 %l = constant i7 -1 ; [#uses=0]
15 %m = constant i7 -1 ; [#uses=0]
16 %m2 = constant i7 -1 ; [#uses=0]
17 %n = constant i7 -2 ; [#uses=0]
18 %t = constant i7 -2 ; [#uses=0]
19 %u = constant i7 -64 ; [#uses=0]
20 %v = constant i7 0 ; [#uses=0]
21 %w = constant i7 2 ; [#uses=0]
22 %x = constant i7 1 ; [#uses=0]
23 %y = constant i7 0 ; [#uses=0]
24 %o = constant i7 0 ; [#uses=0]
25 %p = constant i7 -1 ; [#uses=0]
1 @b = constant i7 0 ; [#uses=0]
2 @q = constant i7 63 ; [#uses=0]
3 @c = constant i7 -2 ; [#uses=0]
4 @d = constant i7 0 ; [#uses=0]
5 @e = constant i7 -1 ; [#uses=0]
6 @f = constant i7 1 ; [#uses=0]
7 @g = constant i7 3 ; [#uses=0]
8 @r = constant i7 5 ; [#uses=0]
9 @s = constant i7 5 ; [#uses=0]
10 @h = constant i7 0 ; [#uses=0]
11 @i = constant i7 -64 ; [#uses=0]
12 @j = constant i7 1 ; [#uses=0]
13 @k = constant i7 0 ; [#uses=0]
14 @l = constant i7 -1 ; [#uses=0]
15 @m = constant i7 -1 ; [#uses=0]
16 @m2 = constant i7 -1 ; [#uses=0]
17 @n = constant i7 -2 ; [#uses=0]
18 @t = constant i7 -2 ; [#uses=0]
19 @u = constant i7 -64 ; [#uses=0]
20 @v = constant i7 0 ; [#uses=0]
21 @w = constant i7 2 ; [#uses=0]
22 @x = constant i7 1 ; [#uses=0]
23 @y = constant i7 0 ; [#uses=0]
24 @o = constant i7 0 ; [#uses=0]
25 @p = constant i7 -1 ; [#uses=0]
2626
2727 implementation ; Functions:
22
33 ; test 9 bits
44 ;
5 %b = constant i9 add(i9 511, i9 1)
6 %c = constant i9 add(i9 511, i9 511)
7 %d = constant i9 add(i9 504, i9 8)
8 %e = constant i9 sub(i9 0 , i9 1)
9 %f = constant i9 sub(i9 0 , i9 511)
10 %g = constant i9 sub(i9 2 , i9 511)
5 @b = constant i9 add(i9 511, i9 1)
6 @c = constant i9 add(i9 511, i9 511)
7 @d = constant i9 add(i9 504, i9 8)
8 @e = constant i9 sub(i9 0 , i9 1)
9 @f = constant i9 sub(i9 0 , i9 511)
10 @g = constant i9 sub(i9 2 , i9 511)
1111
12 %h = constant i9 shl(i9 1 , i8 9)
13 %i = constant i9 shl(i9 1 , i8 8)
14 %j = constant i9 lshr(i9 511 , i8 8)
15 %k = constant i9 lshr(i9 511 , i8 9)
16 %l = constant i9 ashr(i9 511 , i8 8)
17 %m = constant i9 ashr(i9 511 , i8 9)
12 @h = constant i9 shl(i9 1 , i8 9)
13 @i = constant i9 shl(i9 1 , i8 8)
14 @j = constant i9 lshr(i9 511 , i8 8)
15 @k = constant i9 lshr(i9 511 , i8 9)
16 @l = constant i9 ashr(i9 511 , i8 8)
17 @m = constant i9 ashr(i9 511 , i8 9)
1818
19 %n = constant i9 mul(i9 511, i9 2)
20 %q = constant i9 sdiv(i9 511, i9 2)
21 %r = constant i9 udiv(i9 511, i9 2)
22 %s = constant i9 urem(i9 511, i9 -1)
23 %t = constant i9 srem(i9 1, i9 510)
24 %o = constant i9 trunc( i10 512 to i9 )
25 %p = constant i9 trunc( i10 511 to i9 )
19 @n = constant i9 mul(i9 511, i9 2)
20 @q = constant i9 sdiv(i9 511, i9 2)
21 @r = constant i9 udiv(i9 511, i9 2)
22 @s = constant i9 urem(i9 511, i9 -1)
23 @t = constant i9 srem(i9 1, i9 510)
24 @o = constant i9 trunc( i10 512 to i9 )
25 @p = constant i9 trunc( i10 511 to i9 )
2626
0 ; ModuleID = ''
1 %b = constant i9 0 ; [#uses=0]
2 %c = constant i9 -2 ; [#uses=0]
3 %d = constant i9 0 ; [#uses=0]
4 %e = constant i9 -1 ; [#uses=0]
5 %f = constant i9 1 ; [#uses=0]
6 %g = constant i9 3 ; [#uses=0]
7 %h = constant i9 0 ; [#uses=0]
8 %i = constant i9 -256 ; [#uses=0]
9 %j = constant i9 1 ; [#uses=0]
10 %k = constant i9 0 ; [#uses=0]
11 %l = constant i9 -1 ; [#uses=0]
12 %m = constant i9 -1 ; [#uses=0]
13 %n = constant i9 -2 ; [#uses=0]
14 %q = constant i9 0 ; [#uses=0]
15 %r = constant i9 255 ; [#uses=0]
16 %s = constant i9 0 ; [#uses=0]
17 %t = constant i9 1 ; [#uses=0]
18 %o = constant i9 0 ; [#uses=0]
19 %p = constant i9 -1 ; [#uses=0]
1 @b = constant i9 0 ; [#uses=0]
2 @c = constant i9 -2 ; [#uses=0]
3 @d = constant i9 0 ; [#uses=0]
4 @e = constant i9 -1 ; [#uses=0]
5 @f = constant i9 1 ; [#uses=0]
6 @g = constant i9 3 ; [#uses=0]
7 @h = constant i9 0 ; [#uses=0]
8 @i = constant i9 -256 ; [#uses=0]
9 @j = constant i9 1 ; [#uses=0]
10 @k = constant i9 0 ; [#uses=0]
11 @l = constant i9 -1 ; [#uses=0]
12 @m = constant i9 -1 ; [#uses=0]
13 @n = constant i9 -2 ; [#uses=0]
14 @q = constant i9 0 ; [#uses=0]
15 @r = constant i9 255 ; [#uses=0]
16 @s = constant i9 0 ; [#uses=0]
17 @t = constant i9 1 ; [#uses=0]
18 @o = constant i9 0 ; [#uses=0]
19 @p = constant i9 -1 ; [#uses=0]
2020
2121 implementation ; Functions:
11 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
22 ; RUN: diff %t1.ll %t2.ll
33
4 %X = global i19 4, align 16
4 @X = global i19 4, align 16
55
6 define i19 *%test() align 32 {
6 define i19 *@test() align 32 {
77 %X = alloca i19, align 4
88 %Y = alloca i51, i32 42, align 16
99 %Z = alloca i32, align 0
1010 ret i19 *%X
1111 }
1212
13 define i19 *%test2() {
13 define i19 *@test2() {
1414 %X = malloc i19, align 4
1515 %Y = malloc i51, i32 42, align 16
1616 %Z = malloc i32, align 0
66 ; Test "stripped" format where nothing is symbolic... this is how the bytecode
77 ; format looks anyways (except for negative vs positive offsets)...
88 ;
9 define void "void"(i39, i39) ; Def %0, %1
9 define void @"void"(i39, i39) ; Def %0, %1
1010 begin
1111 add i39 0, 0 ; Def 2
1212 sub i39 0, 4 ; Def 3
2626 end
2727
2828 ; This function always returns zero
29 define i39 "zarro"()
29 define i39 @"zarro"()
3030 begin
3131 Startup:
3232 ret i39 0
33
44 %FunTy = type i28(i28)
55
6 declare i28 "test"(...) ; Test differences of prototype
7 declare i28 "test"() ; Differ only by vararg
6 declare i28 @"test"(...) ; Test differences of prototype
7 declare i28 @"test"() ; Differ only by vararg
88
99 implementation
1010
11 define void "invoke"(%FunTy *%x) {
11 define void @"invoke"(%FunTy *%x) {
1212 %foo = call %FunTy* %x(i28 123)
1313 %foo2 = tail call %FunTy* %x(i28 123)
1414 ret void
1515 }
1616
17 define i28 "main"(i28 %argc) ; TODO: , sbyte **argv, sbyte **envp)
17 define i28 @"main"(i28 %argc) ; TODO: , sbyte **argv, sbyte **envp)
1818 begin
19 %retval = call i28 (i28) *%test(i28 %argc)
19 %retval = call i28 (i28) *@test(i28 %argc)
2020 %two = add i28 %retval, %retval
21 %retval2 = invoke i28 %test(i28 %argc)
21 %retval2 = invoke i28 @test(i28 %argc)
2222 to label %Next unwind label %Error
2323 Next:
2424 %two2 = add i28 %two, %retval2
25 call void %invoke (%FunTy* %test)
25 call void @invoke (%FunTy* @test)
2626 ret i28 %two2
2727 Error:
2828 ret i28 -1
2929 end
3030
31 define i28 "test"(i28 %i0)
32 begin
31 define i28 @"test"(i28 %i0) {
3332 ret i28 %i0
34 end
33 }
66 ;; This is an irreducible flow graph
77
88
9 define void "irreducible"(i1 %cond)
9 define void @"irreducible"(i1 %cond)
1010 begin
1111 br i1 %cond, label %X, label %Y
1212
1818
1919 ;; This is a pair of loops that share the same header
2020
21 define void "sharedheader"(i1 %cond)
21 define void @"sharedheader"(i1 %cond)
2222 begin
2323 br label %A
2424 A:
3131 end
3232
3333 ;; This is a simple nested loop
34 define void "nested"(i1 %cond1, i1 %cond2, i1 %cond3)
34 define void @"nested"(i1 %cond1, i1 %cond2, i1 %cond3)
3535 begin
3636 br label %Loop1
3737
1313 global i63 u0x00001 ; hexadecimal unsigned integer constants
1414 global i63 s0x012312 ; hexadecimal signed integer constants
1515
16 %t2 = global i33* %t1 ;; Forward reference without cast
17 %t3 = global i33* bitcast (i33* %t1 to i33*) ;; Forward reference with cast
18 %t1 = global i33 4 ;; i32* %0
19 %t4 = global i33** bitcast (i33** %t3 to i33**) ;; Cast of a previous cast
20 %t5 = global i33** %t3 ;; Reference to a previous cast
21 %t6 = global i33*** %t4
22 %t7 = global float* inttoptr (i32 12345678 to float*) ;; Cast ordinary value to ptr
23 %t9 = global i33 fptosi (float sitofp (i33 8 to float) to i33) ;; Nested cast expression
16 @t2 = global i33* @t1 ;; Forward reference without cast
17 @t3 = global i33* bitcast (i33* @t1 to i33*) ;; Forward reference with cast
18 @t1 = global i33 4 ;; i32* @0
19 @t4 = global i33** bitcast (i33** @t3 to i33**) ;; Cast of a previous cast
20 @t5 = global i33** @t3 ;; Reference to a previous cast
21 @t6 = global i33*** @t4
22 @t7 = global float* inttoptr (i32 12345678 to float*) ;; Cast ordinary value to ptr
23 @t9 = global i33 fptosi (float sitofp (i33 8 to float) to i33) ;; Nested cast expression
2424
2525
26 global i32* bitcast (float* %0 to i32*) ;; Forward numeric reference
27 global float* %0 ;; Duplicate forward numeric reference
26 global i32* bitcast (float* @0 to i32*) ;; Forward numeric reference
27 global float* @0 ;; Duplicate forward numeric reference
2828 global float 0.0
2929
3030
3232 ;; Test constant getelementpr expressions for arrays
3333 ;;---------------------------------------------------
3434
35 %array = constant [2 x i33] [ i33 12, i33 52 ]
36 %arrayPtr = global i33* getelementptr ([2 x i33]* %array, i64 0, i64 0) ;; i33* &%array[0][0]
37 %arrayPtr5 = global i33** getelementptr (i33** %arrayPtr, i64 5) ;; i33* &%arrayPtr[5]
35 @array = constant [2 x i33] [ i33 12, i33 52 ]
36 @arrayPtr = global i33* getelementptr ([2 x i33]* @array, i64 0, i64 0) ;; i33* &@array[0][0]
37 @arrayPtr5 = global i33** getelementptr (i33** @arrayPtr, i64 5) ;; i33* &@arrayPtr[5]
3838
39 %somestr = constant [11x i8] c"hello world"
40 %char5 = global i8* getelementptr([11x i8]* %somestr, i64 0, i64 5)
39 @somestr = constant [11x i8] c"hello world"
40 @char5 = global i8* getelementptr([11x i8]* @somestr, i64 0, i64 5)
4141
4242 ;; cast of getelementptr
43 %char8a = global i33* bitcast (i8* getelementptr([11x i8]* %somestr, i64 0, i64 8) to i33*)
43 @char8a = global i33* bitcast (i8* getelementptr([11x i8]* @somestr, i64 0, i64 8) to i33*)
4444
4545 ;; getelementptr containing casts
46 %char8b = global i8* getelementptr([11x i8]* %somestr, i64 sext (i8 0 to i64), i64 sext (i8 8 to i64))
46 @char8b = global i8* getelementptr([11x i8]* @somestr, i64 sext (i8 0 to i64), i64 sext (i8 8 to i64))
4747
4848 ;;-------------------------------------------------------
4949 ;; TODO: Test constant getelementpr expressions for structures
5252 %SType = type { i33 , {float, {i8} }, i64 } ;; struct containing struct
5353 %SAType = type { i33 , {[2x float], i64} } ;; struct containing array
5454
55 %S1 = global %SType* null ;; Global initialized to NULL
56 %S2c = constant %SType { i33 1, {float,{i8}} {float 2.0, {i8} {i8 3}}, i64 4}
55 @S1 = global %SType* null ;; Global initialized to NULL
56 @S2c = constant %SType { i33 1, {float,{i8}} {float 2.0, {i8} {i8 3}}, i64 4}
5757
58 %S3c = constant %SAType { i33 1, {[2x float], i64} {[2x float] [float 2.0, float 3.0], i64 4} }
58 @S3c = constant %SAType { i33 1, {[2x float], i64} {[2x float] [float 2.0, float 3.0], i64 4} }
5959
60 %S1ptr = global %SType** %S1 ;; Ref. to global S1
61 %S2 = global %SType* %S2c ;; Ref. to constant S2
62 %S3 = global %SAType* %S3c ;; Ref. to constant S3
60 @S1ptr = global %SType** @S1 ;; Ref. to global S1
61 @S2 = global %SType* @S2c ;; Ref. to constant S2
62 @S3 = global %SAType* @S3c ;; Ref. to constant S3
6363
64 ;; Pointer to float (**%S1).1.0
65 %S1fld1a = global float* getelementptr (%SType* %S2c, i64 0, i32 1, i32 0)
64 ;; Pointer to float (**@S1).1.0
65 @S1fld1a = global float* getelementptr (%SType* @S2c, i64 0, i32 1, i32 0)
6666 ;; Another ptr to the same!
67 %S1fld1b = global float* getelementptr (%SType* %S2c, i64 0, i32 1, i32 0)
67 @S1fld1b = global float* getelementptr (%SType* @S2c, i64 0, i32 1, i32 0)
6868
69 %S1fld1bptr = global float** %S1fld1b ;; Ref. to previous pointer
69 @S1fld1bptr = global float** @S1fld1b ;; Ref. to previous pointer
7070
71 ;; Pointer to i8 (**%S2).1.1.0
72 %S2fld3 = global i8* getelementptr (%SType* %S2c, i64 0, i32 1, i32 1, i32 0)
71 ;; Pointer to i8 (**@S2).1.1.0
72 @S2fld3 = global i8* getelementptr (%SType* @S2c, i64 0, i32 1, i32 1, i32 0)
7373
74 ;; Pointer to float (**%S2).1.0[0]
75 ;%S3fld3 = global float* getelementptr (%SAType** %S3, i64 0, i64 0, i32 1, i32 0, i64 0)
74 ;; Pointer to float (**@S2).1.0[0]
75 ;@S3fld3 = global float* getelementptr (%SAType** @S3, i64 0, i64 0, i32 1, i32 0, i64 0)
7676
7777 ;;---------------------------------------------------------
7878 ;; TODO: Test constant expressions for unary and binary operators
99 ;
1010
1111
12 %t3 = global i40 * %t1 ;; Forward reference
13 %t1 = global i40 4
14 %t4 = global i40 ** %t3 ;; reference to reference
12 @t3 = global i40 * @t1 ;; Forward reference
13 @t1 = global i40 4
14 @t4 = global i40 ** @t3 ;; reference to reference
1515
16 %t2 = global i40 * %t1
16 @t2 = global i40 * @t1
1717
18 global float * %0 ;; Forward numeric reference
19 global float * %0 ;; Duplicate forward numeric reference
18 global float * @0 ;; Forward numeric reference
19 global float * @0 ;; Duplicate forward numeric reference
2020 global float 0.0
21 global float * %0 ;; Numeric reference
21 global float * @0 ;; Numeric reference
2222
2323
24 %fptr = global void() * %f ;; Forward ref method defn
25 declare void "f"() ;; External method
24 @fptr = global void() * @f ;; Forward ref method defn
25 declare void @"f"() ;; External method
2626
27 %sptr1 = global [11x i8]* %somestr ;; Forward ref to a constant
28 %somestr = constant [11x i8] c"hello world"
29 %sptr2 = global [11x i8]* %somestr
27 @sptr1 = global [11x i8]* @somestr ;; Forward ref to a constant
28 @somestr = constant [11x i8] c"hello world"
29 @sptr2 = global [11x i8]* @somestr
3030
3131 implementation
3232
1010 %thisfuncty = type i55 (i55) *
1111 implementation
1212
13 declare void %F(%thisfuncty, %thisfuncty, %thisfuncty)
13 declare void @F(%thisfuncty, %thisfuncty, %thisfuncty)
1414
1515 ; This function always returns zero
16 define i55 %zarro(i55 %Func)
16 define i55 @zarro(i55 %Func)
1717 begin
1818 Startup:
1919 add i55 0, 10
2020 ret i55 0
2121 end
2222
23 define i55 %test(i55)
23 define i55 @test(i55)
2424 begin
25 call void %F(%thisfuncty %zarro, %thisfuncty %test, %thisfuncty %foozball)
25 call void @F(%thisfuncty @zarro, %thisfuncty @test, %thisfuncty @foozball)
2626 ret i55 0
2727 end
2828
29 define i55 %foozball(i55)
29 define i55 @foozball(i55)
3030 begin
3131 ret i55 0
3232 end
33
44 ; Test forward references and redefinitions of globals
55
6 %A = global i17* %B
7 %B = global i17 7
6 @A = global i17* @B
7 @B = global i17 7
88
9 declare void %X()
9 declare void @X()
1010
11 declare void %X()
11 declare void @X()
1212
13 define void %X() {
13 define void @X() {
1414 ret void
1515 }
1616
17 declare void %X()
17 declare void @X()
33
44
55
6 %MyVar = external global i27
7 %MyIntList = external global { \2 *, i27 }
6 @MyVar = external global i27
7 @MyIntList = external global { \2 *, i27 }
88 external global i27 ; i27*:0
99
10 %AConst = constant i27 123
10 @AConst = constant i27 123
1111
12 %AString = constant [4 x i8] c"test"
12 @AString = constant [4 x i8] c"test"
1313
14 %ZeroInit = global { [100 x i27 ], [40 x float ] } { [100 x i27] zeroinitializer,
14 @ZeroInit = global { [100 x i27 ], [40 x float ] } { [100 x i27] zeroinitializer,
1515 [40 x float] zeroinitializer }
1616
1717 implementation
1818
19 define i27 "foo"(i27 %blah)
19 define i27 @"foo"(i27 %blah)
2020 begin
21 store i27 5, i27 *%MyVar
22 %idx = getelementptr { \2 *, i27 } * %MyIntList, i64 0, i32 1
21 store i27 5, i27 *@MyVar
22 %idx = getelementptr { \2 *, i27 } * @MyIntList, i64 0, i32 1
2323 store i27 12, i27* %idx
2424 ret i27 %blah
2525 end
33
44 implementation
55
6 define i63 "test"(i63 %X)
6 define i63 @"test"(i63 %X)
77 begin
88 ret i63 %X
99 end
1010
11 define i63 "fib"(i63 %n)
11 define i63 @"fib"(i63 %n)
1212 begin
1313 %T = icmp ult i63 %n, 2 ; {i1}:0
1414 br i1 %T, label %BaseCase, label %RecurseCase
1515
1616 RecurseCase:
17 %result = call i63 %test(i63 %n)
17 %result = call i63 @test(i63 %n)
1818 br label %BaseCase
1919
2020 BaseCase:
33
44 implementation
55
6 declare i32 "atoi"(i8 *)
6 declare i32 @"atoi"(i8 *)
77
8 define i63 "fib"(i63 %n)
8 define i63 @"fib"(i63 %n)
99 begin
1010 icmp ult i63 %n, 2 ; {i1}:0
1111 br i1 %0, label %BaseCase, label %RecurseCase
1616 RecurseCase:
1717 %n2 = sub i63 %n, 2
1818 %n1 = sub i63 %n, 1
19 %f2 = call i63(i63) * %fib(i63 %n2)
20 %f1 = call i63(i63) * %fib(i63 %n1)
19 %f2 = call i63(i63) * @fib(i63 %n2)
20 %f1 = call i63(i63) * @fib(i63 %n1)
2121 %result = add i63 %f2, %f1
2222 ret i63 %result
2323 end
2424
25 define i63 "realmain"(i32 %argc, i8 ** %argv)
25 define i63 @"realmain"(i32 %argc, i8 ** %argv)
2626 begin
2727 icmp eq i32 %argc, 2 ; {i1}:0
2828 br i1 %0, label %HasArg, label %Continue
3434 Continue:
3535 %n = phi i32 [%n1, %HasArg], [1, %0]
3636 %N = sext i32 %n to i63
37 %F = call i63(i63) *%fib(i63 %N)
37 %F = call i63(i63) *@fib(i63 %N)
3838 ret i63 %F
3939 end
4040
41 define i63 "trampoline"(i63 %n, i63(i63)* %fibfunc)
41 define i63 @"trampoline"(i63 %n, i63(i63)* %fibfunc)
4242 begin
4343 %F = call i63(i63) *%fibfunc(i63 %n)
4444 ret i63 %F
4545 end
4646
47 define i32 "main"()
47 define i32 @"main"()
4848 begin
49 %Result = call i63 %trampoline(i63 10, i63(i63) *%fib)
49 %Result = call i63 @trampoline(i63 10, i63(i63) *@fib)
5050 %Result = trunc i63 %Result to i32
5151 ret i32 %Result
5252 end
53
22 ; RUN: diff %t1.ll %t2.ll
33
44
5 define i39 %test_extractelement(<4 x i39> %V) {
5 define i39 @test_extractelement(<4 x i39> %V) {
66 %R = extractelement <4 x i39> %V, i32 1
77 ret i39 %R
88 }
99
10 define <4 x i39> %test_insertelement(<4 x i39> %V) {
10 define <4 x i39> @test_insertelement(<4 x i39> %V) {
1111 %R = insertelement <4 x i39> %V, i39 0, i32 0
1212 ret <4 x i39> %R
1313 }
1414
15 define <4 x i39> %test_shufflevector_u(<4 x i39> %V) {
15 define <4 x i39> @test_shufflevector_u(<4 x i39> %V) {
1616 %R = shufflevector <4 x i39> %V, <4 x i39> %V,
1717 <4 x i32> < i32 1, i32 undef, i32 7, i32 2>
1818 ret <4 x i39> %R
1919 }
2020
21 define <4 x float> %test_shufflevector_f(<4 x float> %V) {
21 define <4 x float> @test_shufflevector_f(<4 x float> %V) {
2222 %R = shufflevector <4 x float> %V, <4 x float> undef,
2323 <4 x i32> < i32 1, i32 undef, i32 7, i32 2>
2424 ret <4 x float> %R
11 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
22 ; RUN: diff %t1.ll %t2.ll
33
4 define void "NewCasts" (i17 %x) {
4 define void @"NewCasts" (i17 %x) {
55 %a = zext i17 %x to i32
66 %b = sext i17 %x to i32
77 %c = trunc i17 %x to i8
1818 }
1919
2020
21 define i17 "ZExtConst" () {
21 define i17 @"ZExtConst" () {
2222 ret i17 trunc ( i32 zext ( i17 42 to i32) to i17 )
2323 }
2424
25 define i17 "SExtConst" () {
25 define i17 @"SExtConst" () {
2626 ret i17 trunc (i32 sext (i17 42 to i32) to i17 )
2727 }
11 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
22 ; RUN: diff %t1.ll %t2.ll
33
4 %foo1 = external global <4 x float>;
5 %foo2 = external global <2 x i10>;
4 @foo1 = external global <4 x float>;
5 @foo2 = external global <2 x i10>;
66
77 implementation ; Functions:
88
9 define void %main()
9 define void @main()
1010 {
11 store <4 x float> , <4 x float>* %foo1
12 store <2 x i10> , <2 x i10>* %foo2
13 %l1 = load <4 x float>* %foo1
14 %l2 = load <2 x i10>* %foo2
11 store <4 x float> , <4 x float>* @foo1
12 store <2 x i10> , <2 x i10>* @foo2
13 %l1 = load <4 x float>* @foo1
14 %l2 = load <2 x i10>* @foo2
1515 ret void
1616 }
44 ; RUN: grep "<{" %t2.ll
55
66 %struct.anon = type <{ i8, i35, i35, i35 }>
7 %foos = external global %struct.anon
8 %bara = external global [2 x <{ i35, i8 }>]
7 @foos = external global %struct.anon
8 @bara = external global [2 x <{ i35, i8 }>]
99
1010 ;initializers should work for packed and non-packed the same way
11 %E1 = global <{i8, i35, i35}> <{i8 1, i35 2, i35 3}>
12 %E2 = global {i8, i35, i35} {i8 4, i35 5, i35 6}
11 @E1 = global <{i8, i35, i35}> <{i8 1, i35 2, i35 3}>
12 @E2 = global {i8, i35, i35} {i8 4, i35 5, i35 6}
1313
1414 implementation ; Functions:
1515
16 define i35 %main()
16 define i35 @main()
1717 {
18 %tmp = load i35* getelementptr (%struct.anon* %foos, i32 0, i32 1) ; [#uses=1]
19 %tmp3 = load i35* getelementptr (%struct.anon* %foos, i32 0, i32 2) ; [#uses=1]
20 %tmp6 = load i35* getelementptr (%struct.anon* %foos, i32 0, i32 3) ; [#uses=1]
18 %tmp = load i35* getelementptr (%struct.anon* @foos, i32 0, i32 1) ; [#uses=1]
19 %tmp3 = load i35* getelementptr (%struct.anon* @foos, i32 0, i32 2) ; [#uses=1]
20 %tmp6 = load i35* getelementptr (%struct.anon* @foos, i32 0, i32 3) ; [#uses=1]
2121 %tmp4 = add i35 %tmp3, %tmp ; [#uses=1]
2222 %tmp7 = add i35 %tmp4, %tmp6 ; [#uses=1]
2323 ret i35 %tmp7
2424 }
2525
26 define i35 %bar() {
26 define i35 @bar() {
2727 entry:
28 %tmp = load i35* getelementptr([2 x <{ i35, i8 }>]* %bara, i32 0, i32 0, i32 0 ) ; [#uses=1]
29 %tmp4 = load i35* getelementptr ([2 x <{ i35, i8 }>]* %bara, i32 0, i32 1, i32 0) ; [#uses=1]
28 %tmp = load i35* getelementptr([2 x <{ i35, i8 }>]* @bara, i32 0, i32 0, i32 0 ) ; [#uses=1]
29 %tmp4 = load i35* getelementptr ([2 x <{ i35, i8 }>]* @bara, i32 0, i32 1, i32 0) ; [#uses=1]
3030 %tmp5 = add i35 %tmp4, %tmp ; [#uses=1]
3131 ret i35 %tmp5
3232 }
44 %ZFunTy = type i33(i8 zext)
55 %SFunTy = type i33(i8 sext)
66
7 declare i16 "test"(i16 sext %arg) sext
8 declare i8 "test2" (i16 zext %a2) zext
7 declare i16 @"test"(i16 sext %arg) sext
8 declare i8 @"test2" (i16 zext %a2) zext
99
1010 implementation
1111
12 define i33 %main(i33 %argc, i8 **%argv) {
12 define i33 @main(i33 %argc, i8 **%argv) {
1313 %val = trunc i33 %argc to i16
14 %res = call i16 (i16 sext) sext *%test(i16 %val)
14 %res = call i16 (i16 sext) sext *@test(i16 %val)
1515 %two = add i16 %res, %res
16 %res = call i8 %test2(i16 %two zext) zext
16 %res = call i8 @test2(i16 %two zext) zext
1717 %retVal = sext i16 %two to i33
1818 ret i33 %retVal
1919 }
22 ; RUN: diff %t1.ll %t2.ll
33
44
5 target endian = little
6 target pointersize = 32
5 target datalayout = "e-p:32:32"
76 target triple = "proc-vend-sys"
87 deplibs = [ "m", "c" ]
98
33
44 implementation
55
6 declare i31 "bar"(i31 %in)
6 declare i31 @"bar"(i31 %in)
77
8 define i31 "foo"(i31 %blah)
8 define i31 @"foo"(i31 %blah)
99 begin
10 %xx = call i31 %bar(i31 %blah)
10 %xx = call i31 @bar(i31 %blah)
1111 ret i31 %xx
1212 end
1313
3939
4040 %list = type { %list*, i36 }
4141
42 declare i8 *"malloc"(i32)
42 declare i8 *@"malloc"(i32)
4343
4444 ;;**********************
4545 implementation
4646 ;;**********************
4747
48 define void "InsertIntoListTail"(%list** %L, i36 %Data)
48 define void @"InsertIntoListTail"(%list** %L, i36 %Data)
4949 begin
5050 bb1:
5151 %reg116 = load %list** %L ;;<%list*>
6565 bb3:
6666 %reg119 = phi %list** [ %reg118, %bb2 ], [ %L, %bb1 ] ;;<%list**>
6767 %cast1006 = bitcast %list** %reg119 to i8** ;;
68 %reg111 = call i8* %malloc(i32 16) ;;
68 %reg111 = call i8* @malloc(i32 16) ;;
6969 store i8* %reg111, i8** %cast1006 ;;
7070 %reg111 = ptrtoint i8* %reg111 to i64
7171 %reg1002 = add i64 %reg111, 8
7878 ret void
7979 end
8080
81 define %list* "FindData"(%list* %L, i36 %Data)
81 define %list* @"FindData"(%list* %L, i36 %Data)
8282 begin
8383 bb1:
8484 br label %bb2
55
66 implementation
77
8 define void "invoke"(%FunTy *%x)
8 define void @"invoke"(%FunTy *%x)
99 begin
1010 %foo = call %FunTy* %x(i31 123)
1111 ret void
1212 end