[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / arm64-be-hfa-vararg.c
bloba4968060e577846e4ec6b17165790f52744fbc03
1 // RUN: %clang_cc1 -triple aarch64_be-linux-gnu -ffreestanding -emit-llvm -O0 -o - %s | FileCheck %s
3 #include <stdarg.h>
5 // A single member HFA must be aligned just like a non-HFA register argument.
6 double callee(int a, ...) {
7 // CHECK: [[REGPP:%.*]] = getelementptr inbounds %struct.__va_list, ptr [[VA:%.*]], i32 0, i32 2
8 // CHECK: [[REGP:%.*]] = load ptr, ptr [[REGPP]], align 8
9 // CHECK: [[OFFSET0:%.*]] = getelementptr inbounds i8, ptr [[REGP]], i32 {{.*}}
10 // CHECK: [[OFFSET1:%.*]] = getelementptr inbounds i8, ptr [[OFFSET0]], i64 8
12 // CHECK: [[MEMPP:%.*]] = getelementptr inbounds %struct.__va_list, ptr [[VA:%.*]], i32 0, i32 0
13 // CHECK: [[MEMP:%.*]] = load ptr, ptr [[MEMPP]], align 8
14 // CHECK: [[NEXTP:%.*]] = getelementptr inbounds i8, ptr [[MEMP]], i64 8
15 // CHECK: store ptr [[NEXTP]], ptr [[MEMPP]], align 8
16 va_list vl;
17 va_start(vl, a);
18 double result = va_arg(vl, struct { double a; }).a;
19 va_end(vl);
20 return result;