[clang] 749083b - [LoongArch] Pre-commit test for issue #70890

Weining Lu via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 1 23:23:13 PDT 2023


Author: Weining Lu
Date: 2023-11-02T14:18:19+08:00
New Revision: 749083b91f31f370cf64831d3e7e6215b6d51442

URL: https://github.com/llvm/llvm-project/commit/749083b91f31f370cf64831d3e7e6215b6d51442
DIFF: https://github.com/llvm/llvm-project/commit/749083b91f31f370cf64831d3e7e6215b6d51442.diff

LOG: [LoongArch] Pre-commit test for issue #70890

Added: 
    clang/test/CodeGen/LoongArch/abi-lp64d-empty-unions.c

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGen/LoongArch/abi-lp64d-empty-unions.c b/clang/test/CodeGen/LoongArch/abi-lp64d-empty-unions.c
new file mode 100644
index 000000000000000..b0607425336e285
--- /dev/null
+++ b/clang/test/CodeGen/LoongArch/abi-lp64d-empty-unions.c
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -triple loongarch64 -target-feature +f -target-feature +d -target-abi lp64d -emit-llvm %s -o - | \
+// RUN:   FileCheck --check-prefix=CHECK-C %s
+// RUN: %clang_cc1 -triple loongarch64 -target-feature +f -target-feature +d -target-abi lp64d -emit-llvm %s -o - -x c++ | \
+// RUN:   FileCheck --check-prefix=CHECK-CXX %s
+
+#include <stdint.h>
+
+// CHECK-C: define{{.*}} void @test1()
+// CHECK-CXX: define{{.*}} i64 @_Z5test12u1(i64{{[^,]*}})
+union u1 { };
+union u1 test1(union u1 a) {
+  return a;
+}
+
+struct s1 {
+  union u1 u;
+  int i;
+  float f;
+};
+
+// CHECK-C: define{{.*}} { i32, float } @test2(i32{{[^,]*}}, float{{[^,]*}})
+/// FIXME: This doesn't match g++.
+// CHECK-CXX: define{{.*}} { i32, float } @_Z5test22s1(i32{{[^,]*}}, float{{[^,]*}})
+struct s1 test2(struct s1 a) {
+  return a;
+}


        


More information about the cfe-commits mailing list