OLD | NEW |
---|---|
1 ; Test the "vmrs APSR_nzcv, FPSCR" form of the VMRS instruction. | 1 ; Show that we can translate IR instruction "trap". |
2 | 2 |
3 ; Note: We use integer division to test this, since a trap is inserted | |
Jim Stichnoth
2016/01/29 20:49:53
Could you also test the "unreachable" bitcode inst
Karl
2016/01/29 22:00:36
Done.
| |
4 ; if one divides by zero. | |
5 | |
3 ; REQUIRES: allow_dump | 6 ; REQUIRES: allow_dump |
4 | 7 |
5 ; Compile using standalone assembler. | 8 ; Compile using standalone assembler. |
6 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \ | 9 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \ |
7 ; RUN: | FileCheck %s --check-prefix=ASM | 10 ; RUN: | FileCheck %s --check-prefix=ASM |
8 | 11 |
9 ; Show bytes in assembled standalone code. | 12 ; Show bytes in assembled standalone code. |
10 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ | 13 ; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ |
11 ; RUN: --args -Om1 \ | 14 ; RUN: --args -Om1 \ |
12 ; RUN: | FileCheck %s --check-prefix=DIS | 15 ; RUN: | FileCheck %s --check-prefix=DIS |
13 | 16 |
14 ; Compile using integrated assembler. | 17 ; Compile using integrated assembler. |
15 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \ | 18 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \ |
16 ; RUN: | FileCheck %s --check-prefix=IASM | 19 ; RUN: | FileCheck %s --check-prefix=IASM |
17 | 20 |
18 ; Show bytes in assembled integrated code. | 21 ; Show bytes in assembled integrated code. |
19 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \ | 22 ; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \ |
20 ; RUN: --args -Om1 \ | 23 ; RUN: --args -Om1 \ |
21 ; RUN: | FileCheck %s --check-prefix=DIS | 24 ; RUN: | FileCheck %s --check-prefix=DIS |
22 | 25 |
23 define internal i32 @testVmrsASPR_nzcv() { | 26 define internal i32 @testTrap(i32 %v1, i32 %v2) { |
24 ; ASM-LABEL: testVmrsASPR_nzcv: | 27 ; ASM-LABEL: testTrap: |
25 ; DIS-LABEL: 00000000 <testVmrsASPR_nzcv>: | 28 ; DIS-LABEL: 00000000 <testTrap>: |
29 ; IASM-LABEL: testTrap: | |
26 | 30 |
27 entry: | 31 %res = udiv i32 %v1, %v2 |
28 ; ASM: .LtestVmrsASPR_nzcv$entry: | |
29 | 32 |
30 %test = fcmp olt float 0.0, 0.0 | 33 ; ASM: bne |
34 ; DIS: 18:» 1a000000 | |
Jim Stichnoth
2016/01/29 20:49:53
tabs
| |
35 ; IASM-NOT: bne | |
31 | 36 |
32 ; ASM: vmrs APSR_nzcv, FPSCR | 37 ; ASM-NEXT: .long 0xe7fedef0 |
33 ; DIS: 14: eef1fa10 | 38 ; DIS-NEXT: 1c:» e7fedef0 |
34 ; IASM-NOT: vmrs | 39 ; IASM-NOT: .long |
35 | 40 |
36 %result = zext i1 %test to i32 | 41 ret i32 %res |
37 ret i32 %result | |
38 } | 42 } |
OLD | NEW |