[llvm-branch-commits] [clang] ca93f9a - [Clang][CodeGen][RISCV] Add hard float ABI tests with empty struct

Luís Marques via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 8 01:26:01 PST 2020


Author: Luís Marques
Date: 2020-12-08T09:19:05Z
New Revision: ca93f9abdc0abc96ca8fb7999549a50aadd95caf

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

LOG: [Clang][CodeGen][RISCV] Add hard float ABI tests with empty struct

This patch adds tests that showcase a behavior that is currently buggy.
Fix in a follow-up patch.

Differential Revision: https://reviews.llvm.org/D91269

Added: 
    clang/test/CodeGen/riscv32-ilp32d-abi.cpp

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGen/riscv32-ilp32d-abi.cpp b/clang/test/CodeGen/riscv32-ilp32d-abi.cpp
new file mode 100644
index 000000000000..ffebb057e230
--- /dev/null
+++ b/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;
+}


        


More information about the llvm-branch-commits mailing list