xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/arm64-be-hfa-vararg.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN:  %clang_cc1 -triple aarch64_be-linux-gnu -ffreestanding -emit-llvm -O0 -o - %s | FileCheck %s
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc #include <stdarg.h>
4*0a6a1f1dSLionel Sambuc 
5*0a6a1f1dSLionel Sambuc // A single member HFA must be aligned just like a non-HFA register argument.
callee(int a,...)6*0a6a1f1dSLionel Sambuc double callee(int a, ...) {
7*0a6a1f1dSLionel Sambuc // CHECK: = add i64 %{{.*}}, 8
8*0a6a1f1dSLionel Sambuc   va_list vl;
9*0a6a1f1dSLionel Sambuc   va_start(vl, a);
10*0a6a1f1dSLionel Sambuc   double result = va_arg(vl, struct { double a; }).a;
11*0a6a1f1dSLionel Sambuc   va_end(vl);
12*0a6a1f1dSLionel Sambuc   return result;
13*0a6a1f1dSLionel Sambuc }
14