• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Show that we know how to translate rsc
2
3; NOTE: We use -O2 to get rid of memory stores.
4
5; REQUIRES: allow_dump
6
7; Compile using standalone assembler.
8; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -O2 \
9; RUN:   | FileCheck %s --check-prefix=ASM
10
11; Show bytes in assembled standalone code.
12; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
13; RUN:   --args -O2 | FileCheck %s --check-prefix=DIS
14
15; Compile using integrated assembler.
16; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -O2 \
17; RUN:   | FileCheck %s --check-prefix=IASM
18
19; Show bytes in assembled integrated code.
20; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
21; RUN:   --args -O2 | FileCheck %s --check-prefix=DIS
22
23define internal i64 @NegateI64(i64 %a) {
24; ASM-LABEL:NegateI64:
25; DIS-LABEL:00000000 <NegateI64>:
26; IASM-LABEL:NegateI64:
27
28entry:
29; ASM-NEXT:.LNegateI64$entry:
30; IASM-NEXT:.LNegateI64$entry:
31
32  %res = sub i64 0, %a
33
34; ASM-NEXT:     rsbs    r0, r0, #0
35; DIS-NEXT:   0:        e2700000
36; IASM-NEXT:	.byte 0x0
37; IASM-NEXT:	.byte 0x0
38; IASM-NEXT:	.byte 0x70
39; IASM-NEXT:	.byte 0xe2
40
41; ASM-NEXT:     rsc     r1, r1, #0
42; DIS-NEXT:   4:        e2e11000
43; IASM-NEXT:	.byte 0x0
44; IASM-NEXT:	.byte 0x10
45; IASM-NEXT:	.byte 0xe1
46; IASM-NEXT:	.byte 0xe2
47
48  ret i64 %res
49}
50