OLD | NEW |
1 ; RUN: llc < %s -mtriple=arm-nacl-gnueabi | FileCheck %s | 1 ; RUN: llc < %s -mtriple=armv7-nacl-gnueabi | FileCheck %s |
| 2 ; @LOCALMOD: change to armv7, (or alternatively +v6t2) since NaCl needs |
| 3 ; movw/movt to materialize the @va_list global address. |
2 | 4 |
3 declare void @llvm.va_start(i8*) | 5 declare void @llvm.va_start(i8*) |
4 declare void @external_func(i8*) | 6 declare void @external_func(i8*) |
5 | 7 |
6 @va_list = external global i8* | 8 @va_list = external global i8* |
7 | 9 |
8 ; On ARM, varargs arguments are passed in r0-r3 with the rest on the | 10 ; On ARM, varargs arguments are passed in r0-r3 with the rest on the |
9 ; stack. A varargs function must therefore spill rN-r3 just below the | 11 ; stack. A varargs function must therefore spill rN-r3 just below the |
10 ; function's initial stack pointer. | 12 ; function's initial stack pointer. |
11 ; | 13 ; |
12 ; This test checks for a bug in which a gap was left between the spill | 14 ; This test checks for a bug in which a gap was left between the spill |
13 ; area and varargs arguments on the stack when using 16 byte stack | 15 ; area and varargs arguments on the stack when using 16 byte stack |
14 ; alignment. | 16 ; alignment. |
15 | 17 |
16 define void @varargs_func(i32 %arg1, ...) { | 18 define void @varargs_func(i32 %arg1, ...) { |
17 call void @llvm.va_start(i8* bitcast (i8** @va_list to i8*)) | 19 call void @llvm.va_start(i8* bitcast (i8** @va_list to i8*)) |
18 call void @external_func(i8* bitcast (i8** @va_list to i8*)) | 20 call void @external_func(i8* bitcast (i8** @va_list to i8*)) |
19 ret void | 21 ret void |
20 } | 22 } |
21 ; CHECK-LABEL: varargs_func: | 23 ; CHECK-LABEL: varargs_func: |
22 ; Reserve space for the varargs save area. This currently reserves | 24 ; Reserve space for the varargs save area. This currently reserves |
23 ; more than enough (16 bytes rather than the 12 bytes needed). | 25 ; more than enough (16 bytes rather than the 12 bytes needed). |
24 ; CHECK: sub sp, sp, #16 | 26 ; CHECK: sub sp, sp, #16 |
25 ; CHECK: push {r11, lr} | 27 ; CHECK: push {r11, lr} |
26 ; Align the stack pointer to a multiple of 16. | 28 ; Align the stack pointer to a multiple of 16. |
27 ; CHECK: sub sp, sp, #8 | 29 ; CHECK: sub sp, sp, #8 |
28 ; Calculate the address of the varargs save area and save varargs | 30 ; Calculate the address of the varargs save area and save varargs |
29 ; arguments into it. | 31 ; arguments into it. |
30 ; CHECK-NEXT: add r0, sp, #20 | 32 ; @LOCALMOD: Adjust test expectation, removing NEXT to allow CFI |
31 ; CHECK-NEXT: stm r0, {r1, r2, r3} | 33 ; directive to intervene in the output. |
| 34 ; CHECK: add r0, sp, #20 |
| 35 ; @LOCALMOD: Adjust test expectation, removing NEXT to allow sandboxing. |
| 36 ; CHECK: stm r0, {r1, r2, r3} |
OLD | NEW |