[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / arm-vaarg.c
blobbed008039274abdcefd567c5bc696ba3ddf73536
1 // RUN: %clang -mfloat-abi=soft -target arm-linux-gnu -emit-llvm -S -o - %s | FileCheck %s
3 struct Empty {};
5 struct Empty emptyvar;
7 void take_args(int a, ...) {
8 // CHECK: [[ALLOCA_VA_LIST:%[a-zA-Z0-9._]+]] = alloca %struct.__va_list, align 4
9 // CHECK: call void @llvm.va_start
10 // CHECK-NEXT: [[LOAD_AP:%[a-zA-Z0-9._]+]] = load ptr, ptr [[ALLOCA_VA_LIST]], align 4
12 // It's conceivable that EMPTY_PTR may not actually be a valid pointer
13 // (e.g. it's at the very bottom of the stack and the next page is
14 // invalid). This doesn't matter provided it's never loaded (there's no
15 // well-defined way to tell), but it becomes a problem if we do try to use it.
16 // CHECK-NOT: load %struct.Empty, ptr [[LOAD_AP]]
17 __builtin_va_list l;
18 __builtin_va_start(l, a);
19 emptyvar = __builtin_va_arg(l, struct Empty);
20 __builtin_va_end(l);