Chris Lattner | 9cc0da9 | 2010-03-15 20:39:00 +0000 | [diff] [blame] | 1 | ; RUN: llc %s -o - |
| 2 | |
| 3 | ;; Reference to a label that gets deleted. |
| 4 | define i8* @test1() nounwind { |
| 5 | entry: |
| 6 | ret i8* blockaddress(@test1b, %test_label) |
| 7 | } |
| 8 | |
| 9 | define i32 @test1b() nounwind { |
| 10 | entry: |
| 11 | ret i32 -1 |
| 12 | test_label: |
| 13 | br label %ret |
| 14 | ret: |
| 15 | ret i32 -1 |
| 16 | } |
| 17 | |
| 18 | |
| 19 | ;; Issues with referring to a label that gets RAUW'd later. |
| 20 | define i32 @test2a() nounwind { |
| 21 | entry: |
| 22 | %target = bitcast i8* blockaddress(@test2b, %test_label) to i8* |
| 23 | |
| 24 | call i32 @test2b(i8* %target) |
| 25 | |
| 26 | ret i32 0 |
| 27 | } |
| 28 | |
| 29 | define i32 @test2b(i8* %target) nounwind { |
| 30 | entry: |
| 31 | indirectbr i8* %target, [label %test_label] |
| 32 | |
| 33 | test_label: |
| 34 | ; assume some code here... |
| 35 | br label %ret |
| 36 | |
| 37 | ret: |
| 38 | ret i32 -1 |
| 39 | } |