| OLD | NEW |
| 1 ; This tests that unreachable basic blocks are pruned from the CFG, so that | 1 ; This tests that unreachable basic blocks are pruned from the CFG, so that |
| 2 ; liveness analysis doesn't detect inconsistencies. | 2 ; liveness analysis doesn't detect inconsistencies. |
| 3 | 3 |
| 4 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 | FileCheck %s | 4 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -Om1 \ |
| 5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 | FileCheck %s | 5 ; RUN: -allow-externally-defined-symbols | FileCheck %s |
| 6 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 \ |
| 7 ; RUN: -allow-externally-defined-symbols | FileCheck %s |
| 6 | 8 |
| 7 declare void @abort() | 9 declare void @abort() |
| 8 | 10 |
| 9 define i32 @unreachable_block() { | 11 define internal i32 @unreachable_block() { |
| 10 entry: | 12 entry: |
| 11 ; ret_val has no reaching uses and so its assignment may be | 13 ; ret_val has no reaching uses and so its assignment may be |
| 12 ; dead-code eliminated. | 14 ; dead-code eliminated. |
| 13 %ret_val = add i32 undef, undef | 15 %ret_val = add i32 undef, undef |
| 14 call void @abort() | 16 call void @abort() |
| 15 unreachable | 17 unreachable |
| 16 label: | 18 label: |
| 17 ; ret_val has no reaching definitions, causing an inconsistency in | 19 ; ret_val has no reaching definitions, causing an inconsistency in |
| 18 ; liveness analysis. | 20 ; liveness analysis. |
| 19 ret i32 %ret_val | 21 ret i32 %ret_val |
| 20 } | 22 } |
| 21 | 23 |
| 22 ; CHECK-LABEL: unreachable_block | 24 ; CHECK-LABEL: unreachable_block |
| OLD | NEW |