NAKAMURA Takumi | 9dceb13 | 2010-09-03 03:24:08 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -mtriple=i686-linux | FileCheck %s |
Duncan Sands | a5fec0d | 2009-03-17 09:46:22 +0000 | [diff] [blame] | 2 | ; Check the register copy comes after the call to f and before the call to g |
Evan Cheng | fc0b80d | 2009-03-13 22:59:14 +0000 | [diff] [blame] | 3 | ; PR3784 |
| 4 | |
Duncan Sands | a5fec0d | 2009-03-17 09:46:22 +0000 | [diff] [blame] | 5 | declare i32 @f() |
Evan Cheng | fc0b80d | 2009-03-13 22:59:14 +0000 | [diff] [blame] | 6 | |
Duncan Sands | a5fec0d | 2009-03-17 09:46:22 +0000 | [diff] [blame] | 7 | declare i32 @g() |
| 8 | |
| 9 | define i32 @phi() { |
Evan Cheng | fc0b80d | 2009-03-13 22:59:14 +0000 | [diff] [blame] | 10 | entry: |
Duncan Sands | a5fec0d | 2009-03-17 09:46:22 +0000 | [diff] [blame] | 11 | %a = call i32 @f() ; <i32> [#uses=1] |
| 12 | %b = invoke i32 @g() |
| 13 | to label %cont unwind label %lpad ; <i32> [#uses=1] |
Evan Cheng | fc0b80d | 2009-03-13 22:59:14 +0000 | [diff] [blame] | 14 | |
Duncan Sands | a5fec0d | 2009-03-17 09:46:22 +0000 | [diff] [blame] | 15 | cont: ; 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 Cheng | fc0b80d | 2009-03-13 22:59:14 +0000 | [diff] [blame] | 20 | |
Duncan Sands | a5fec0d | 2009-03-17 09:46:22 +0000 | [diff] [blame] | 21 | cont2: ; preds = %cont |
| 22 | %xx = phi i32 [ %bb, %cont ] ; <i32> [#uses=1] |
| 23 | ret i32 %xx |
Evan Cheng | fc0b80d | 2009-03-13 22:59:14 +0000 | [diff] [blame] | 24 | |
Duncan Sands | a5fec0d | 2009-03-17 09:46:22 +0000 | [diff] [blame] | 25 | lpad: ; preds = %cont, %entry |
| 26 | %y = phi i32 [ %a, %entry ], [ %aa, %cont ] ; <i32> [#uses=1] |
Bill Wendling | 9359031 | 2011-08-31 21:39:05 +0000 | [diff] [blame^] | 27 | %exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0 |
| 28 | cleanup |
Duncan Sands | a5fec0d | 2009-03-17 09:46:22 +0000 | [diff] [blame] | 29 | ret i32 %y |
Evan Cheng | fc0b80d | 2009-03-13 22:59:14 +0000 | [diff] [blame] | 30 | } |
Edward O'Callaghan | 81fff07 | 2009-11-22 11:45:44 +0000 | [diff] [blame] | 31 | |
| 32 | ; CHECK: call{{.*}}f |
Jakob Stoklund Olesen | 49b2803 | 2011-05-04 23:54:59 +0000 | [diff] [blame] | 33 | ; CHECK: movl %eax, %esi |
| 34 | ; CHECK: call{{.*}}g |
Bill Wendling | 9359031 | 2011-08-31 21:39:05 +0000 | [diff] [blame^] | 35 | |
| 36 | declare i32 @__gxx_personality_v0(...) |