blob: 04182a7cdd11555f29e2a81694a5aeb9f7e311df [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; try to check that we have the most important instructions, which shouldn't
2; appear otherwise
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +00003; RUN: llvm-as < %s | llc -march=alpha | grep jmp
4; RUN: llvm-as < %s | llc -march=alpha | grep gprel32
5; RUN: llvm-as < %s | llc -march=alpha | grep ldl
6; RUN: llvm-as < %s | llc -march=alpha | grep rodata
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +00008target datalayout = "e-p:64:64"
Dan Gohmanf17a25c2007-07-18 16:29:46 +00009target triple = "alphaev67-unknown-linux-gnu"
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000010@str = internal constant [2 x i8] c"1\00" ; <[2 x i8]*> [#uses=1]
11@str1 = internal constant [2 x i8] c"2\00" ; <[2 x i8]*> [#uses=1]
12@str2 = internal constant [2 x i8] c"3\00" ; <[2 x i8]*> [#uses=1]
13@str3 = internal constant [2 x i8] c"4\00" ; <[2 x i8]*> [#uses=1]
14@str4 = internal constant [2 x i8] c"5\00" ; <[2 x i8]*> [#uses=1]
15@str5 = internal constant [2 x i8] c"6\00" ; <[2 x i8]*> [#uses=1]
16@str6 = internal constant [2 x i8] c"7\00" ; <[2 x i8]*> [#uses=1]
17@str7 = internal constant [2 x i8] c"8\00" ; <[2 x i8]*> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000018
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000019define i32 @main(i32 %x, i8** %y) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020entry:
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000021 %x_addr = alloca i32 ; <i32*> [#uses=2]
22 %y_addr = alloca i8** ; <i8***> [#uses=1]
23 %retval = alloca i32, align 4 ; <i32*> [#uses=2]
24 %tmp = alloca i32, align 4 ; <i32*> [#uses=2]
25 %foo = alloca i8*, align 8 ; <i8**> [#uses=9]
26 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
27 store i32 %x, i32* %x_addr
28 store i8** %y, i8*** %y_addr
29 %tmp.upgrd.1 = load i32* %x_addr ; <i32> [#uses=1]
30 switch i32 %tmp.upgrd.1, label %bb15 [
31 i32 1, label %bb
32 i32 2, label %bb1
33 i32 3, label %bb3
34 i32 4, label %bb5
35 i32 5, label %bb7
36 i32 6, label %bb9
37 i32 7, label %bb11
38 i32 8, label %bb13
39 ]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000040
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000041bb: ; preds = %entry
42 %tmp.upgrd.2 = getelementptr [2 x i8]* @str, i32 0, i64 0 ; <i8*> [#uses=1]
43 store i8* %tmp.upgrd.2, i8** %foo
44 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000045
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000046bb1: ; preds = %entry
47 %tmp2 = getelementptr [2 x i8]* @str1, i32 0, i64 0 ; <i8*> [#uses=1]
48 store i8* %tmp2, i8** %foo
49 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000050
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000051bb3: ; preds = %entry
52 %tmp4 = getelementptr [2 x i8]* @str2, i32 0, i64 0 ; <i8*> [#uses=1]
53 store i8* %tmp4, i8** %foo
54 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000055
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000056bb5: ; preds = %entry
57 %tmp6 = getelementptr [2 x i8]* @str3, i32 0, i64 0 ; <i8*> [#uses=1]
58 store i8* %tmp6, i8** %foo
59 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000060
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000061bb7: ; preds = %entry
62 %tmp8 = getelementptr [2 x i8]* @str4, i32 0, i64 0 ; <i8*> [#uses=1]
63 store i8* %tmp8, i8** %foo
64 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000065
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000066bb9: ; preds = %entry
67 %tmp10 = getelementptr [2 x i8]* @str5, i32 0, i64 0 ; <i8*> [#uses=1]
68 store i8* %tmp10, i8** %foo
69 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000070
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000071bb11: ; preds = %entry
72 %tmp12 = getelementptr [2 x i8]* @str6, i32 0, i64 0 ; <i8*> [#uses=1]
73 store i8* %tmp12, i8** %foo
74 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000075
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000076bb13: ; preds = %entry
77 %tmp14 = getelementptr [2 x i8]* @str7, i32 0, i64 0 ; <i8*> [#uses=1]
78 store i8* %tmp14, i8** %foo
79 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000080
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000081bb15: ; preds = %entry
82 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000083
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000084bb16: ; preds = %bb15, %bb13, %bb11, %bb9, %bb7, %bb5, %bb3, %bb1, %bb
85 %tmp17 = load i8** %foo ; <i8*> [#uses=1]
86 %tmp18 = call i32 (...)* @print( i8* %tmp17 ) ; <i32> [#uses=0]
87 store i32 0, i32* %tmp
88 %tmp19 = load i32* %tmp ; <i32> [#uses=1]
89 store i32 %tmp19, i32* %retval
90 br label %return
Dan Gohmanf17a25c2007-07-18 16:29:46 +000091
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000092return: ; preds = %bb16
93 %retval.upgrd.3 = load i32* %retval ; <i32> [#uses=1]
94 ret i32 %retval.upgrd.3
Dan Gohmanf17a25c2007-07-18 16:29:46 +000095}
96
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000097declare i32 @print(...)
98