[PATCH] D91269: [Clang][CodeGen][RISCV] Add hard float ABI tests with empty struct
Luís Marques via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 11 08:22:51 PST 2020
luismarques created this revision.
luismarques added reviewers: asb, lenary, rjmccall, efriedma.
Herald added subscribers: cfe-commits, frasercrmck, NickHung, evandro, apazos, sameer.abuasal, pzheng, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar.
Herald added a project: clang.
luismarques requested review of this revision.
This patch adds tests that showcase a behavior that is currently buggy.
Fix in a follow-up patch.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D91269
Files:
clang/test/CodeGen/riscv32-ilp32d-abi.cpp
Index: clang/test/CodeGen/riscv32-ilp32d-abi.cpp
===================================================================
--- /dev/null
+++ clang/test/CodeGen/riscv32-ilp32d-abi.cpp
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -triple riscv32 -target-feature +d -target-abi ilp32d \
+// RUN: -Wno-missing-declarations -emit-llvm %s -o - | FileCheck %s
+
+struct empty_float2 { struct {}; float f; float g; };
+
+// CHECK: define float @_Z14f_empty_float212empty_float2(float %0, float %1)
+// FIXME: Extraneous padding before the second float
+// CHECK: { [4 x i8], float, [4 x i8], float }
+float f_empty_float2(empty_float2 a) {
+ return a.g;
+}
+
+struct empty_double2 { struct {}; double f; double g; };
+
+// CHECK: define double @_Z15f_empty_double213empty_double2(double %0, double %1)
+// FIXME: Extraneous padding before the second double
+// CHECK: { [8 x i8], double, [8 x i8], double }
+double f_empty_double2(empty_double2 a) {
+ return a.g;
+}
+
+struct empty_float_double { struct {}; float f; double g; };
+
+// CHECK: define double @_Z20f_empty_float_double18empty_float_double(float %0, double %1)
+// CHECK: { [4 x i8], float, double }
+double f_empty_float_double(empty_float_double a) {
+ return a.g;
+}
+
+struct empty_double_float { struct {}; double f; float g; };
+
+// CHECK: define double @_Z20f_empty_double_float18empty_double_float(double %0, float %1)
+// FIXME: Extraneous padding before the float
+// CHECK: { [8 x i8], double, [8 x i8], float }
+double f_empty_double_float(empty_double_float a) {
+ return a.g;
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91269.304524.patch
Type: text/x-patch
Size: 1552 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201111/e9c73d0e/attachment.bin>
More information about the cfe-commits
mailing list