OLD | NEW |
1 ; This tests the basic structure of the Unreachable instruction. | 1 ; This tests the basic structure of the Unreachable instruction. |
2 | 2 |
3 ; RUN: %p2i -i %s -a -O2 --verbose none \ | 3 ; RUN: %p2i -i %s --assemble --disassemble -a -O2 --verbose none \ |
4 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ | 4 ; RUN: | FileCheck %s |
5 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 5 ; RUN: %p2i -i %s --assemble --disassemble -a -Om1 --verbose none \ |
6 ; RUN: %p2i -i %s -a -Om1 --verbose none \ | 6 ; RUN: | FileCheck %s |
7 ; RUN: | llvm-mc -triple=i686-none-nacl -filetype=obj \ | |
8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | |
9 | 7 |
10 define internal i32 @divide(i32 %num, i32 %den) { | 8 define internal i32 @divide(i32 %num, i32 %den) { |
11 entry: | 9 entry: |
12 %cmp = icmp ne i32 %den, 0 | 10 %cmp = icmp ne i32 %den, 0 |
13 br i1 %cmp, label %return, label %abort | 11 br i1 %cmp, label %return, label %abort |
14 | 12 |
15 abort: ; preds = %entry | 13 abort: ; preds = %entry |
16 unreachable | 14 unreachable |
17 | 15 |
18 return: ; preds = %entry | 16 return: ; preds = %entry |
19 %div = sdiv i32 %num, %den | 17 %div = sdiv i32 %num, %den |
20 ret i32 %div | 18 ret i32 %div |
21 } | 19 } |
22 | 20 |
23 ; CHECK-LABEL: divide | 21 ; CHECK-LABEL: divide |
24 ; CHECK: cmp | 22 ; CHECK: cmp |
25 ; CHECK: call ice_unreachable | 23 ; CHECK: call |
| 24 ; CHECK-NEXT: R_{{.*}} ice_unreachable |
26 ; CHECK: cdq | 25 ; CHECK: cdq |
27 ; CHECK: idiv | 26 ; CHECK: idiv |
28 ; CHECK: ret | 27 ; CHECK: ret |
OLD | NEW |