From 65807250035e1f9631e863ac6cc9af74c39d4c4f Mon Sep 17 00:00:00 2001From: Weining Lu <luweining@loongson.cn>Date: 2023年10月26日 11:50:28 +0800Subject: [PATCH 10/27] [LoongArch][test] Add some ABI regression tests forempty struct. NFCHow empty structs (not as fields of container struct) are passed in C++is not explicitly documented in psABI. This patch adds some testsshowing the current handing of clang. Some of the results are differentfrom gcc. Following patch(es) will try to fix the mismatch.(cherry picked from commit 8149066fa532d82ff62a0629d5a9fab6bd4da768)---.../LoongArch/abi-lp64d-empty-structs.c | 53 +++++++++++++++++++1 file changed, 53 insertions(+)diff --git a/clang/test/CodeGen/LoongArch/abi-lp64d-empty-structs.c b/clang/test/CodeGen/LoongArch/abi-lp64d-empty-structs.cindex fb90bf556c19..d0daafac336e 100644--- a/clang/test/CodeGen/LoongArch/abi-lp64d-empty-structs.c+++ b/clang/test/CodeGen/LoongArch/abi-lp64d-empty-structs.c@@ -81,9 +81,62 @@ struct s8 test_s8(struct s8 a) {return a;}+/// Note: Below tests check how empty structs are passed while above tests check+/// empty structs as fields of container struct are ignored when flattening+/// structs to examine whether the container structs can be passed via FARs.+// CHECK-C: define{{.*}} void @test_s9()// CHECK-CXX: define{{.*}} i64 @_Z7test_s92s9(i64 {{.*}})struct s9 { struct empty e; };struct s9 test_s9(struct s9 a) {return a;}++// CHECK-C: define{{.*}} void @test_s10()+// CHECK-CXX: define{{.*}} void @_Z8test_s103s10()+struct s10 { };+struct s10 test_s10(struct s10 a) {+ return a;+}++// CHECK-C: define{{.*}} void @test_s11()+// CHECK-CXX: define{{.*}} i64 @_Z8test_s113s11(i64 {{.*}})+struct s11 { struct { } s; };+struct s11 test_s11(struct s11 a) {+ return a;+}++// CHECK-C: define{{.*}} void @test_s12()+// CHECK-CXX: define{{.*}} void @_Z8test_s123s12()+struct s12 { int i[0]; };+struct s12 test_s12(struct s12 a) {+ return a;+}++// CHECK-C: define{{.*}} void @test_s13()+// CHECK-CXX: define{{.*}} void @_Z8test_s133s13()+struct s13 { struct { } s[0]; };+struct s13 test_s13(struct s13 a) {+ return a;+}++// CHECK-C: define{{.*}} void @test_s14()+// CHECK-CXX: define{{.*}} i64 @_Z8test_s143s14(i64 {{.*}})+struct s14 { struct { } s[1]; };+struct s14 test_s14(struct s14 a) {+ return a;+}++// CHECK-C: define{{.*}} void @test_s15()+// CHECK-CXX: define{{.*}} void @_Z8test_s153s15()+struct s15 { int : 0; };+struct s15 test_s15(struct s15 a) {+ return a;+}++// CHECK-C: define{{.*}} void @test_s16()+// CHECK-CXX: define{{.*}} void @_Z8test_s163s16()+struct s16 { int : 1; };+struct s16 test_s16(struct s16 a) {+ return a;+}--2.20.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。