summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/riscv64-lp64-abi.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGen/riscv64-lp64-abi.c')
-rw-r--r--clang/test/CodeGen/riscv64-lp64-abi.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/CodeGen/riscv64-lp64-abi.c b/clang/test/CodeGen/riscv64-lp64-abi.c
index bae5470c377..a89e75e58a4 100644
--- a/clang/test/CodeGen/riscv64-lp64-abi.c
+++ b/clang/test/CodeGen/riscv64-lp64-abi.c
@@ -30,3 +30,24 @@ struct large f_scalar_stack_2(double a, __int128_t b, long double c, v32i8 d,
uint8_t e, int8_t f, uint8_t g) {
return (struct large){a, e, f, g};
}
+
+// Complex floating-point values or structs containing a single complex
+// floating-point value should be passed in a GPR.
+
+// CHECK: define void @f_floatcomplex(i64 %a.coerce)
+void f_floatcomplex(float __complex__ a) {}
+
+// CHECK: define i64 @f_ret_floatcomplex()
+float __complex__ f_ret_floatcomplex() {
+ return 1.0;
+}
+
+struct floatcomplex_s { float __complex__ c; };
+
+// CHECK: define void @f_floatcomplex_s_arg(i64 %a.coerce)
+void f_floatcomplex_s_arg(struct floatcomplex_s a) {}
+
+// CHECK: define i64 @f_ret_floatcomplex_s()
+struct floatcomplex_s f_ret_floatcomplex_s() {
+ return (struct floatcomplex_s){1.0};
+}
OpenPOWER on IntegriCloud