• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -O1 -mcpu=atom -mtriple=i686-linux  | FileCheck %s
2
3declare void @external_function(...)
4
5define i32 @test_return_val(i32 %a) nounwind {
6; CHECK: test_return_val
7; CHECK: movl
8; CHECK: nop
9; CHECK: nop
10; CHECK: nop
11; CHECK: nop
12; CHECK: nop
13; CHECK: nop
14; CHECK: ret
15  ret i32 %a
16}
17
18define i32 @test_optsize(i32 %a) nounwind optsize {
19; CHECK: test_optsize
20; CHECK: movl
21; CHECK-NEXT: ret
22  ret i32 %a
23}
24
25define i32 @test_minsize(i32 %a) nounwind minsize {
26; CHECK: test_minsize
27; CHECK: movl
28; CHECK-NEXT: ret
29  ret i32 %a
30}
31
32define i32 @test_pgso(i32 %a) nounwind !prof !14 {
33; CHECK: test_pgso
34; CHECK: movl
35; CHECK-NEXT: ret
36  ret i32 %a
37}
38
39define i32 @test_add(i32 %a, i32 %b) nounwind {
40; CHECK: test_add
41; CHECK: addl
42; CHECK: nop
43; CHECK: nop
44; CHECK: nop
45; CHECK: nop
46; CHECK: ret
47  %result = add i32 %a, %b
48  ret i32 %result
49}
50
51define i32 @test_multiple_ret(i32 %a, i32 %b, i1 %c) nounwind {
52; CHECK: @test_multiple_ret
53; CHECK: je
54
55; CHECK: nop
56; CHECK: nop
57; CHECK: ret
58
59; CHECK: nop
60; CHECK: nop
61; CHECK: ret
62
63  br i1 %c, label %bb1, label %bb2
64
65bb1:
66  ret i32 %a
67
68bb2:
69  ret i32 %b
70}
71
72define void @test_call_others(i32 %x) nounwind
73{
74; CHECK: test_call_others
75; CHECK: je
76  %tobool = icmp eq i32 %x, 0
77  br i1 %tobool, label %if.end, label %true.case
78
79; CHECK: jmp external_function
80true.case:
81  tail call void bitcast (void (...)* @external_function to void ()*)() nounwind
82  br label %if.end
83
84; CHECK: nop
85; CHECK: nop
86; CHECK: nop
87; CHECK: nop
88; CHECK: ret
89if.end:
90  ret void
91
92}
93
94define void @test_branch_to_same_bb(i32 %x, i32 %y) nounwind {
95; CHECK: @test_branch_to_same_bb
96  %cmp = icmp sgt i32 %x, 0
97  br i1 %cmp, label %while.cond, label %while.end
98
99while.cond:
100  br label %while.cond
101
102; CHECK: nop
103; CHECK: nop
104; CHECK: nop
105; CHECK: nop
106; CHECK: ret
107while.end:
108  ret void
109}
110
111!llvm.module.flags = !{!0}
112!0 = !{i32 1, !"ProfileSummary", !1}
113!1 = !{!2, !3, !4, !5, !6, !7, !8, !9}
114!2 = !{!"ProfileFormat", !"InstrProf"}
115!3 = !{!"TotalCount", i64 10000}
116!4 = !{!"MaxCount", i64 10}
117!5 = !{!"MaxInternalCount", i64 1}
118!6 = !{!"MaxFunctionCount", i64 1000}
119!7 = !{!"NumCounts", i64 3}
120!8 = !{!"NumFunctions", i64 3}
121!9 = !{!"DetailedSummary", !10}
122!10 = !{!11, !12, !13}
123!11 = !{i32 10000, i64 100, i32 1}
124!12 = !{i32 999000, i64 100, i32 1}
125!13 = !{i32 999999, i64 1, i32 2}
126!14 = !{!"function_entry_count", i64 0}
127