blob: e9fbe797f5bca57eb763c82fab7813ecb0d0bc54 [file] [log] [blame]
Dale Johannesenc48eb5f2007-10-06 01:22:39 +00001; RUN: llvm-as < %s | llc -march=x86 | grep lea
Evan Cheng6d174ec2007-10-05 23:33:09 +00002
3 %struct.anon = type { [3 x double], double, %struct.node*, [64 x %struct.bnode*], [64 x %struct.bnode*] }
4 %struct.bnode = type { i16, double, [3 x double], i32, i32, [3 x double], [3 x double], [3 x double], double, %struct.bnode*, %struct.bnode* }
5 %struct.node = type { i16, double, [3 x double], i32, i32 }
6
Evan Chengf2704c02009-02-21 02:06:47 +00007define i32 @main(i32 %argc, i8** nocapture %argv) nounwind {
Evan Cheng6d174ec2007-10-05 23:33:09 +00008entry:
Evan Chengf2704c02009-02-21 02:06:47 +00009 %0 = malloc %struct.anon ; <%struct.anon*> [#uses=2]
10 %1 = getelementptr %struct.anon* %0, i32 0, i32 2 ; <%struct.node**> [#uses=1]
11 br label %bb14.i
Evan Cheng6d174ec2007-10-05 23:33:09 +000012
Evan Chengf2704c02009-02-21 02:06:47 +000013bb14.i: ; preds = %bb14.i, %entry
14 %i8.0.reg2mem.0.i = phi i32 [ 0, %entry ], [ %2, %bb14.i ] ; <i32> [#uses=1]
15 %2 = add i32 %i8.0.reg2mem.0.i, 1 ; <i32> [#uses=2]
16 %exitcond74.i = icmp eq i32 %2, 32 ; <i1> [#uses=1]
17 br i1 %exitcond74.i, label %bb32.i, label %bb14.i
Evan Cheng6d174ec2007-10-05 23:33:09 +000018
Evan Chengf2704c02009-02-21 02:06:47 +000019bb32.i: ; preds = %bb32.i, %bb14.i
20 %tmp.0.reg2mem.0.i = phi i32 [ %indvar.next63.i, %bb32.i ], [ 0, %bb14.i ] ; <i32> [#uses=1]
21 %indvar.next63.i = add i32 %tmp.0.reg2mem.0.i, 1 ; <i32> [#uses=2]
22 %exitcond64.i = icmp eq i32 %indvar.next63.i, 64 ; <i1> [#uses=1]
23 br i1 %exitcond64.i, label %bb47.loopexit.i, label %bb32.i
Evan Cheng6d174ec2007-10-05 23:33:09 +000024
Evan Chengf2704c02009-02-21 02:06:47 +000025bb.i.i: ; preds = %bb47.loopexit.i
26 unreachable
Evan Cheng6d174ec2007-10-05 23:33:09 +000027
Evan Chengf2704c02009-02-21 02:06:47 +000028stepsystem.exit.i: ; preds = %bb47.loopexit.i
29 store %struct.node* null, %struct.node** %1, align 4
30 br label %bb.i6.i
Evan Cheng6d174ec2007-10-05 23:33:09 +000031
Evan Chengf2704c02009-02-21 02:06:47 +000032bb.i6.i: ; preds = %bb.i6.i, %stepsystem.exit.i
33 %tmp.0.i.i = add i32 0, -1 ; <i32> [#uses=1]
34 %3 = icmp slt i32 %tmp.0.i.i, 0 ; <i1> [#uses=1]
35 br i1 %3, label %bb107.i.i, label %bb.i6.i
36
37bb107.i.i: ; preds = %bb107.i.i, %bb.i6.i
38 %q_addr.0.i.i.in = phi %struct.bnode** [ null, %bb107.i.i ], [ %4, %bb.i6.i ] ; <%struct.bnode**> [#uses=1]
39 %q_addr.0.i.i = load %struct.bnode** %q_addr.0.i.i.in ; <%struct.bnode*> [#uses=0]
40 br label %bb107.i.i
41
42bb47.loopexit.i: ; preds = %bb32.i
43 %4 = getelementptr %struct.anon* %0, i32 0, i32 4, i32 0 ; <%struct.bnode**> [#uses=1]
44 %5 = icmp eq %struct.node* null, null ; <i1> [#uses=1]
45 br i1 %5, label %stepsystem.exit.i, label %bb.i.i
Evan Cheng6d174ec2007-10-05 23:33:09 +000046}