blob: e14c30a27449dddb0dfb6845dcd8a1d3f46b4977 [file] [log] [blame]
NAKAMURA Takumi9dceb132010-09-03 03:24:08 +00001; RUN: llc < %s -mtriple=i686-linux | FileCheck %s
Duncan Sandsa5fec0d2009-03-17 09:46:22 +00002; Check the register copy comes after the call to f and before the call to g
Evan Chengfc0b80d2009-03-13 22:59:14 +00003; PR3784
4
Duncan Sandsa5fec0d2009-03-17 09:46:22 +00005declare i32 @f()
Evan Chengfc0b80d2009-03-13 22:59:14 +00006
Duncan Sandsa5fec0d2009-03-17 09:46:22 +00007declare i32 @g()
8
9define i32 @phi() {
Evan Chengfc0b80d2009-03-13 22:59:14 +000010entry:
Duncan Sandsa5fec0d2009-03-17 09:46:22 +000011 %a = call i32 @f() ; <i32> [#uses=1]
12 %b = invoke i32 @g()
13 to label %cont unwind label %lpad ; <i32> [#uses=1]
Evan Chengfc0b80d2009-03-13 22:59:14 +000014
Duncan Sandsa5fec0d2009-03-17 09:46:22 +000015cont: ; preds = %entry
16 %x = phi i32 [ %b, %entry ] ; <i32> [#uses=0]
17 %aa = call i32 @g() ; <i32> [#uses=1]
18 %bb = invoke i32 @g()
19 to label %cont2 unwind label %lpad ; <i32> [#uses=1]
Evan Chengfc0b80d2009-03-13 22:59:14 +000020
Duncan Sandsa5fec0d2009-03-17 09:46:22 +000021cont2: ; preds = %cont
22 %xx = phi i32 [ %bb, %cont ] ; <i32> [#uses=1]
23 ret i32 %xx
Evan Chengfc0b80d2009-03-13 22:59:14 +000024
Duncan Sandsa5fec0d2009-03-17 09:46:22 +000025lpad: ; preds = %cont, %entry
26 %y = phi i32 [ %a, %entry ], [ %aa, %cont ] ; <i32> [#uses=1]
Bill Wendling93590312011-08-31 21:39:05 +000027 %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
28 cleanup
Duncan Sandsa5fec0d2009-03-17 09:46:22 +000029 ret i32 %y
Evan Chengfc0b80d2009-03-13 22:59:14 +000030}
Edward O'Callaghan81fff072009-11-22 11:45:44 +000031
32; CHECK: call{{.*}}f
Jakob Stoklund Olesen49b28032011-05-04 23:54:59 +000033; CHECK: movl %eax, %esi
34; CHECK: call{{.*}}g
Bill Wendling93590312011-08-31 21:39:05 +000035
36declare i32 @__gxx_personality_v0(...)