[AMDGPU] Update base addr of dyn alloca considering GrowingUp stack (#119822)
[llvm-project.git] / clang / test / CodeGen / AArch64 / pure-scalable-args-empty-union.c
blob546910068c78a221093cd03f770b06cd86dfadc0
1 // RUN: %clang_cc1 -O3 -triple aarch64 -target-feature +sve -mvscale-min=1 -mvscale-max=1 -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK-C
2 // RUN: %clang_cc1 -x c++ -O3 -triple aarch64 -target-feature +sve -mvscale-min=1 -mvscale-max=1 -emit-llvm -o - %s | FileCheck %s --check-prefixes=CHECK-CXX
4 typedef __SVFloat32_t fvec32 __attribute__((arm_sve_vector_bits(128)));
6 // PST containing an empty union: when compiled as C pass it in registers,
7 // when compiled as C++ - in memory.
8 typedef struct {
9 fvec32 x[4];
10 union {} u;
11 } S0;
13 #ifdef __cplusplus
14 extern "C"
15 #endif
16 void use0(S0);
18 void f0(S0 *p) {
19 use0(*p);
21 // CHECK-C: declare void @use0(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>)
22 // CHECK-CXX: declare void @use0(ptr noundef)
24 #ifdef __cplusplus
26 // PST containing an empty union with `[[no_unique_address]]`` - pass in registers.
27 typedef struct {
28 fvec32 x[4];
29 [[no_unique_address]]
30 union {} u;
31 } S1;
33 extern "C" void use1(S1);
34 void f1(S1 *p) {
35 use1(*p);
37 // CHECK-CXX: declare void @use1(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>)
39 #endif // __cplusplus