blob: 7d3e225a1e29a0c46d1b09526d7b3bcb7ef570ce [file] [log] [blame]
Hal Finkel5ee67e82013-04-08 16:24:03 +00001; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s
2target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
3target triple = "powerpc64-unknown-linux-gnu"
4
5define void @foo(i32* %P) #0 {
6entry:
7 %tobool = icmp eq i32* %P, null
8 br i1 %tobool, label %if.end, label %if.then
9
10if.then: ; preds = %entry
Manman Ren2dc50d32013-04-30 17:52:57 +000011 store i32 0, i32* %P, align 4
Hal Finkel5ee67e82013-04-08 16:24:03 +000012 br label %if.end
13
14if.end: ; preds = %entry, %if.then
15 ret void
16
17; CHECK: @foo
18; CHECK: beqlr
19; CHECK: blr
20}
21
22define void @bar(i32* %P, i32* %Q) #0 {
23entry:
24 %tobool = icmp eq i32* %P, null
25 br i1 %tobool, label %if.else, label %if.then
26
27if.then: ; preds = %entry
Manman Ren2dc50d32013-04-30 17:52:57 +000028 store i32 0, i32* %P, align 4
Hal Finkel5ee67e82013-04-08 16:24:03 +000029 %tobool1 = icmp eq i32* %Q, null
30 br i1 %tobool1, label %if.end3, label %if.then2
31
32if.then2: ; preds = %if.then
Manman Ren2dc50d32013-04-30 17:52:57 +000033 store i32 1, i32* %Q, align 4
Hal Finkel5ee67e82013-04-08 16:24:03 +000034 br label %if.end3
35
36if.else: ; preds = %entry
Manman Ren2dc50d32013-04-30 17:52:57 +000037 store i32 0, i32* %Q, align 4
Hal Finkel5ee67e82013-04-08 16:24:03 +000038 br label %if.end3
39
40if.end3: ; preds = %if.then, %if.then2, %if.else
41 ret void
42
43; CHECK: @bar
44; CHECK: beqlr
45; CHECK: blr
46}
47
48attributes #0 = { nounwind }