brintos

brintos / llvm-project-archived public Read only

0
0
Text · 734 B · b2be740 Raw
21 lines · c
1// RUN: %clang -mfloat-abi=soft -target arm-linux-gnu -emit-llvm -S -o - %s | FileCheck %s2 3struct Empty {};4 5struct Empty emptyvar;6 7void take_args(int a, ...) {8// CHECK: [[ALLOCA_VA_LIST:%[a-zA-Z0-9._]+]] = alloca %struct.__va_list, align 49// CHECK: call void @llvm.va_start10 11  // It's conceivable that EMPTY_PTR may not actually be a valid pointer12  // (e.g. it's at the very bottom of the stack and the next page is13  // invalid). This doesn't matter provided it's never loaded (there's no14  // well-defined way to tell), but it becomes a problem if we do try to use it.15// CHECK-NOT: load %struct.Empty16  __builtin_va_list l;17  __builtin_va_start(l, a);18  emptyvar = __builtin_va_arg(l, struct Empty);19  __builtin_va_end(l);20}21