1 // RUN: %clang_cc1 -triple arm -target-abi aapcs %s -emit-llvm -o - | FileCheck -check-prefix=AAPCS %s
2 // RUN: %clang_cc1 -triple arm -target-abi apcs-gnu %s -emit-llvm -o - | FileCheck -check-prefix=APCS-GNU %s
4 * Check that va_arg accesses stack according to ABI alignment
5 * long long and double require 8-byte alignment under AAPCS
6 * however, they only require 4-byte alignment under APCS
8 long long t1(int i, ...) {
12 __builtin_va_start(ap, i);
13 // AAPCS: add i32 %{{.*}} 7
14 // AAPCS: and i32 %{{.*}} -8
15 // APCS-GNU-NOT: add i32 %{{.*}} 7
16 // APCS-GNU-NOT: and i32 %{{.*}} -8
17 long long ll = __builtin_va_arg(ap, long long);
21 double t2(int i, ...) {
25 __builtin_va_start(ap, i);
26 // AAPCS: add i32 %{{.*}} 7
27 // AAPCS: and i32 %{{.*}} -8
28 // APCS-GNU-NOT: add i32 %{{.*}} 7
29 // APCS-GNU-NOT: and i32 %{{.*}} -8
30 double ll = __builtin_va_arg(ap, double);