• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Show that we can handle variable (i.e. stack) spills.
2
3; REQUIRES: allow_dump
4
5; Compile using standalone assembler.
6; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \
7; RUN:   | FileCheck %s --check-prefix=ASM
8
9; Show bytes in assembled standalone code.
10; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \
11; RUN:   --args -Om1 | FileCheck %s --check-prefix=DIS
12
13; Compile using integrated assembler.
14; RUN: %p2i --filetype=iasm -i %s --target=arm32 --args -Om1 \
15; RUN:   | FileCheck %s --check-prefix=IASM
16
17; Show bytes in assembled integrated code.
18; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \
19; RUN:   --args -Om1 | FileCheck %s --check-prefix=DIS
20
21define internal i32 @add1ToR0(i32 %p) {
22  %v = add i32 %p, 1
23  ret i32 %v
24}
25
26; ASM-LABEL: add1ToR0:
27; IASM-LABEL: add1ToR0:
28; DIS-LABEL:00000000 <add1ToR0>:
29
30; ASM:          sub     sp, sp, #8
31; DIS-NEXT:   0:        e24dd008
32; IASM:         .byte 0x8
33; IASM-NEXT:    .byte 0xd0
34; IASM-NEXT:    .byte 0x4d
35; IASM-NEXT:    .byte 0xe2
36
37; ASM-NEXT:     str     r0, [sp, #4]
38; ASM-NEXT:     # [sp, #4] = def.pseudo
39; DIS-NEXT:   4:        e58d0004
40; IASM-NEXT:    .byte 0x4
41; IASM-NEXT:    .byte 0x0
42; IASM-NEXT:    .byte 0x8d
43; IASM-NEXT:    .byte 0xe5
44
45; ASM-NEXT:     ldr     r0, [sp, #4]
46; DIS-NEXT:   8:        e59d0004
47; IASM-NEXT:    .byte 0x4
48; IASM-NEXT:    .byte 0x0
49; IASM-NEXT:    .byte 0x9d
50; IASM-NEXT:    .byte 0xe5
51
52; ASM-NEXT:     add     r0, r0, #1
53; DIS-NEXT:   c:        e2800001
54; IASM-NEXT:    .byte 0x1
55; IASM-NEXT:    .byte 0x0
56; IASM-NEXT:    .byte 0x80
57; IASM-NEXT:    .byte 0xe2
58
59; ASM-NEXT:     str     r0, [sp]
60; ASM-NEXT:     # [sp] = def.pseudo
61; DIS-NEXT:  10:        e58d0000
62; IASM-NEXT:    .byte 0x0
63; IASM-NEXT:    .byte 0x0
64; IASM-NEXT:    .byte 0x8d
65; IASM-NEXT:    .byte 0xe5
66
67; ASM-NEXT:     ldr     r0, [sp]
68; DIS-NEXT:  14:        e59d0000
69; IASM-NEXT:    .byte 0x0
70; IASM-NEXT:    .byte 0x0
71; IASM-NEXT:    .byte 0x9d
72; IASM-NEXT:    .byte 0xe5
73
74; ASM-NEXT:     add     sp, sp, #8
75; DIS-NEXT:  18:        e28dd008
76; IASM-NEXT:    .byte 0x8
77; IASM-NEXT:    .byte 0xd0
78; IASM-NEXT:    .byte 0x8d
79; IASM-NEXT:    .byte 0xe2
80
81; ASM-NEXT:     bx      lr
82; DIS-NEXT:  1c:        e12fff1e
83; IASM-NEXT:    .byte 0x1e
84; IASM-NEXT:    .byte 0xff
85; IASM-NEXT:    .byte 0x2f
86; IASM-NEXT:    .byte 0xe1
87