@@ -1001,3 +1001,29 @@ void foo36() {
1001
1001
// OGCG: %[[A_IMAG_F32:.*]] = fpext half %[[A_IMAG]] to float
1002
1002
// OGCG: %[[A_IMAG_F16:.*]] = fptrunc float %[[A_IMAG_F32]] to half
1003
1003
// OGCG: store half %[[A_IMAG_F16]], ptr %[[IMAG_ADDR]], align 2
1004
+
1005
+ void foo37 () {
1006
+ _Complex float a;
1007
+ _Complex float b = __extension__ a;
1008
+ }
1009
+
1010
+ // CIR: %[[A_ADDR:.*]] = cir.alloca !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>, ["a"]
1011
+ // CIR: %[[B_ADDR:.*]] = cir.alloca !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>, ["b", init]
1012
+ // CIR: %[[TMP_A:.*]] = cir.load{{.*}} %[[A_ADDR]] : !cir.ptr<!cir.complex<!cir.float>>, !cir.complex<!cir.float>
1013
+ // CIR: cir.store{{.*}} %[[TMP_A]], %[[B_ADDR]] : !cir.complex<!cir.float>, !cir.ptr<!cir.complex<!cir.float>>
1014
+
1015
+ // LLVM: %[[A_ADDR:.*]] = alloca { float, float }, i64 1, align 4
1016
+ // LLVM: %[[B_ADDR:.*]] = alloca { float, float }, i64 1, align 4
1017
+ // LLVM: %[[TMP_A:.*]] = load { float, float }, ptr %[[A_ADDR]], align 4
1018
+ // LLVM: store { float, float } %[[TMP_A]], ptr %[[B_ADDR]], align 4
1019
+
1020
+ // OGCG: %[[A_ADDR:.*]] = alloca { float, float }, align 4
1021
+ // OGCG: %[[B_ADDR:.*]] = alloca { float, float }, align 4
1022
+ // OGCG: %[[A_REAL_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[A_ADDR]], i32 0, i32 0
1023
+ // OGCG: %[[A_REAL:.*]] = load float, ptr %[[A_REAL_PTR]], align 4
1024
+ // OGCG: %[[A_IMAG_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[A_ADDR]], i32 0, i32 1
1025
+ // OGCG: %[[A_IMAG:.*]] = load float, ptr %[[A_IMAG_PTR]], align 4
1026
+ // OGCG: %[[B_REAL_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[B_ADDR]], i32 0, i32 0
1027
+ // OGCG: %[[B_IMAG_PTR:.*]] = getelementptr inbounds nuw { float, float }, ptr %[[B_ADDR]], i32 0, i32 1
1028
+ // OGCG: store float %[[A_REAL]], ptr %[[B_REAL_PTR]], align 4
1029
+ // OGCG: store float %[[A_IMAG]], ptr %[[B_IMAG_PTR]], align 4
0 commit comments