xref: /llvm-project/clang/test/CodeGen/LoongArch/abi-lp64d-empty-unions.c (revision 4253fdc2c462da61cc0deb74a43265665720c828)
1 // RUN: %clang_cc1 -triple loongarch64 -target-feature +f -target-feature +d -target-abi lp64d -emit-llvm %s -o - | \
2 // RUN:   FileCheck --check-prefix=CHECK-C %s
3 // RUN: %clang_cc1 -triple loongarch64 -target-feature +f -target-feature +d -target-abi lp64d -emit-llvm %s -o - -x c++ | \
4 // RUN:   FileCheck --check-prefix=CHECK-CXX %s
5 
6 #include <stdint.h>
7 
8 // CHECK-C: define{{.*}} void @test1()
9 // CHECK-CXX: define{{.*}} i64 @_Z5test12u1(i64{{[^,]*}})
10 union u1 { };
test1(union u1 a)11 union u1 test1(union u1 a) {
12   return a;
13 }
14 
15 struct s1 {
16   union u1 u;
17   int i;
18   float f;
19 };
20 
21 // CHECK-C: define{{.*}} { i32, float } @test2(i32{{[^,]*}}, float{{[^,]*}})
22 // CHECK-CXX: define{{.*}} [2 x i64] @_Z5test22s1([2 x i64]{{[^,]*}})
test2(struct s1 a)23 struct s1 test2(struct s1 a) {
24   return a;
25 }
26