blob: 917c9327dc16ff054f779a144f7cc8f654fd489c [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
Dan Gohmanda594cf2009-09-09 00:09:15 +00003; RUN: llc < %s -march=alpha | grep jmp
4; RUN: llc < %s -march=alpha | grep gprel32
5; RUN: llc < %s -march=alpha | grep ldl
6; RUN: llc < %s -march=alpha | grep rodata
Tanya Lattner15b014b2008-03-09 08:16:40 +00007; END.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +00009target datalayout = "e-p:64:64"
Dan Gohmanf17a25c2007-07-18 16:29:46 +000010target triple = "alphaev67-unknown-linux-gnu"
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000011@str = internal constant [2 x i8] c"1\00" ; <[2 x i8]*> [#uses=1]
12@str1 = internal constant [2 x i8] c"2\00" ; <[2 x i8]*> [#uses=1]
13@str2 = internal constant [2 x i8] c"3\00" ; <[2 x i8]*> [#uses=1]
14@str3 = internal constant [2 x i8] c"4\00" ; <[2 x i8]*> [#uses=1]
15@str4 = internal constant [2 x i8] c"5\00" ; <[2 x i8]*> [#uses=1]
16@str5 = internal constant [2 x i8] c"6\00" ; <[2 x i8]*> [#uses=1]
17@str6 = internal constant [2 x i8] c"7\00" ; <[2 x i8]*> [#uses=1]
18@str7 = internal constant [2 x i8] c"8\00" ; <[2 x i8]*> [#uses=1]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000019
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000020define i32 @main(i32 %x, i8** %y) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000021entry:
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000022 %x_addr = alloca i32 ; <i32*> [#uses=2]
23 %y_addr = alloca i8** ; <i8***> [#uses=1]
24 %retval = alloca i32, align 4 ; <i32*> [#uses=2]
25 %tmp = alloca i32, align 4 ; <i32*> [#uses=2]
26 %foo = alloca i8*, align 8 ; <i8**> [#uses=9]
27 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
28 store i32 %x, i32* %x_addr
29 store i8** %y, i8*** %y_addr
30 %tmp.upgrd.1 = load i32* %x_addr ; <i32> [#uses=1]
31 switch i32 %tmp.upgrd.1, label %bb15 [
32 i32 1, label %bb
33 i32 2, label %bb1
34 i32 3, label %bb3
35 i32 4, label %bb5
36 i32 5, label %bb7
37 i32 6, label %bb9
38 i32 7, label %bb11
39 i32 8, label %bb13
40 ]
Dan Gohmanf17a25c2007-07-18 16:29:46 +000041
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000042bb: ; preds = %entry
43 %tmp.upgrd.2 = getelementptr [2 x i8]* @str, i32 0, i64 0 ; <i8*> [#uses=1]
44 store i8* %tmp.upgrd.2, i8** %foo
45 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000046
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000047bb1: ; preds = %entry
48 %tmp2 = getelementptr [2 x i8]* @str1, i32 0, i64 0 ; <i8*> [#uses=1]
49 store i8* %tmp2, i8** %foo
50 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000051
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000052bb3: ; preds = %entry
53 %tmp4 = getelementptr [2 x i8]* @str2, i32 0, i64 0 ; <i8*> [#uses=1]
54 store i8* %tmp4, i8** %foo
55 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000056
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000057bb5: ; preds = %entry
58 %tmp6 = getelementptr [2 x i8]* @str3, i32 0, i64 0 ; <i8*> [#uses=1]
59 store i8* %tmp6, i8** %foo
60 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000061
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000062bb7: ; preds = %entry
63 %tmp8 = getelementptr [2 x i8]* @str4, i32 0, i64 0 ; <i8*> [#uses=1]
64 store i8* %tmp8, i8** %foo
65 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000066
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000067bb9: ; preds = %entry
68 %tmp10 = getelementptr [2 x i8]* @str5, i32 0, i64 0 ; <i8*> [#uses=1]
69 store i8* %tmp10, i8** %foo
70 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000071
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000072bb11: ; preds = %entry
73 %tmp12 = getelementptr [2 x i8]* @str6, i32 0, i64 0 ; <i8*> [#uses=1]
74 store i8* %tmp12, i8** %foo
75 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000076
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000077bb13: ; preds = %entry
78 %tmp14 = getelementptr [2 x i8]* @str7, i32 0, i64 0 ; <i8*> [#uses=1]
79 store i8* %tmp14, i8** %foo
80 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000081
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000082bb15: ; preds = %entry
83 br label %bb16
Dan Gohmanf17a25c2007-07-18 16:29:46 +000084
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000085bb16: ; preds = %bb15, %bb13, %bb11, %bb9, %bb7, %bb5, %bb3, %bb1, %bb
86 %tmp17 = load i8** %foo ; <i8*> [#uses=1]
87 %tmp18 = call i32 (...)* @print( i8* %tmp17 ) ; <i32> [#uses=0]
88 store i32 0, i32* %tmp
89 %tmp19 = load i32* %tmp ; <i32> [#uses=1]
90 store i32 %tmp19, i32* %retval
91 br label %return
Dan Gohmanf17a25c2007-07-18 16:29:46 +000092
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000093return: ; preds = %bb16
94 %retval.upgrd.3 = load i32* %retval ; <i32> [#uses=1]
95 ret i32 %retval.upgrd.3
Dan Gohmanf17a25c2007-07-18 16:29:46 +000096}
97
Tanya Lattnerf28e0ce2008-02-19 01:41:04 +000098declare i32 @print(...)
99