[PATCH] D91278: [Clang][CodeGen][RISCV] Fix hard float ABI for struct with empty struct and complex
Luís Marques via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 11 09:34:17 PST 2020
luismarques updated this revision to Diff 304554.
luismarques added a comment.
Fix bad test.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91278/new/
https://reviews.llvm.org/D91278
Files:
clang/lib/CodeGen/TargetInfo.cpp
clang/test/CodeGen/riscv32-ilp32d-abi.cpp
Index: clang/test/CodeGen/riscv32-ilp32d-abi.cpp
===================================================================
--- clang/test/CodeGen/riscv32-ilp32d-abi.cpp
+++ clang/test/CodeGen/riscv32-ilp32d-abi.cpp
@@ -32,3 +32,11 @@
double f_empty_double_float(empty_double_float a) {
return a.g;
}
+
+struct empty_complex { struct {}; double _Complex fc; };
+
+// CHECK: define double @_Z15f_empty_complex13empty_complex(double %0, double %1)
+// CHECK: { [8 x i8], double, double }
+double f_empty_complex(empty_complex a) {
+ return __imag__ a.fc;
+}
Index: clang/lib/CodeGen/TargetInfo.cpp
===================================================================
--- clang/lib/CodeGen/TargetInfo.cpp
+++ clang/lib/CodeGen/TargetInfo.cpp
@@ -10479,7 +10479,6 @@
return false;
Field1Ty = CGT.ConvertType(EltTy);
Field1Off = CurOff;
- assert(CurOff.isZero() && "Unexpected offset for first field");
Field2Ty = Field1Ty;
Field2Off = Field1Off + getContext().getTypeSizeInChars(EltTy);
return true;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91278.304554.patch
Type: text/x-patch
Size: 1033 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201111/cb1398a7/attachment.bin>
More information about the cfe-commits
mailing list