Skip to content

Commit 64b8a63

Browse files
cebowlerZarkoT
authored andcommitted
[NFC] [PPC] Add PowerPC expected IR tests for C99 complex
Adding this test so that I can extend it in a follow on patch with expected IR for AIX when I implement complex handling in AIXABIInfo. Reviewed By: daltenty, ZarkoCA Differential Revision: https://reviews.llvm.org/D88105
1 parent 6f7fbdd commit 64b8a63

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// RUN: %clang_cc1 -triple powerpc64-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefixes=PPC64LNX
2+
// RUN: %clang_cc1 -triple ppc64le-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefixes=PPC64LNX
3+
// RUN: %clang_cc1 -triple powerpc-unknown-linux -emit-llvm %s -o - | FileCheck %s --check-prefix=PPC32LNX
4+
5+
_Complex float foo1(_Complex float x) {
6+
return x;
7+
// PPC64LNX-LABEL: define { float, float } @foo1(float %x.{{.*}}, float %x.{{.*}}) #0 {
8+
// PPC64LNX: ret { float, float }
9+
10+
// PPC32LNX-LABEL: define void @foo1({ float, float }* noalias sret align 4 %agg.result, { float, float }* byval({ float, float }) align 4 %x) #0 {
11+
// PPC32LNX: [[RETREAL:%.*]] = getelementptr inbounds { float, float }, { float, float }* %agg.result, i32 0, i32 0
12+
// PPC32LNX-NEXT: [[RETIMAG:%.*]] = getelementptr inbounds { float, float }, { float, float }* %agg.result, i32 0, i32 1
13+
// PPC32LNX-NEXT: store float %{{.*}}, float* [[RETREAL]], align 4
14+
// PPC32LNX-NEXT: store float %{{.*}}, float* [[RETIMAG]], align 4
15+
}
16+
17+
_Complex double foo2(_Complex double x) {
18+
return x;
19+
// PPC64LNX-LABEL: define { double, double } @foo2(double %x.{{.*}}, double %x.{{.*}}) #0 {
20+
// PPC64LNX: ret { double, double }
21+
22+
// PPC32LNX-LABEL: define void @foo2({ double, double }* noalias sret align 8 %agg.result, { double, double }* byval({ double, double }) align 8 %x) #0 {
23+
// PPC32LNX: [[RETREAL:%.*]] = getelementptr inbounds { double, double }, { double, double }* %agg.result, i32 0, i32 0
24+
// PPC32LNX-NEXT: [[RETIMAG:%.*]] = getelementptr inbounds { double, double }, { double, double }* %agg.result, i32 0, i32 1
25+
// PPC32LNX-NEXT: store double %{{.*}}, double* [[RETREAL]], align 8
26+
// PPC32LNX-NEXT: store double %{{.*}}, double* [[RETIMAG]], align 8
27+
}
28+
29+
_Complex long double foo3(_Complex long double x) {
30+
return x;
31+
// PPC64LNX-LABEL: define { ppc_fp128, ppc_fp128 } @foo3(ppc_fp128 %x.{{.*}}, ppc_fp128 %x.{{.*}}) #0 {
32+
// PPC64LNX: ret { ppc_fp128, ppc_fp128 }
33+
34+
// PPC32LNX-LABEL: define void @foo3({ ppc_fp128, ppc_fp128 }* noalias sret align 16 %agg.result, { ppc_fp128, ppc_fp128 }* byval({ ppc_fp128, ppc_fp128 }) align 16 %x) #0 {
35+
// PPC32LNX: [[RETREAL:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %agg.result, i32 0, i32 0
36+
// PPC32LNX-NEXT: [[RETIMAG:%.*]] = getelementptr inbounds { ppc_fp128, ppc_fp128 }, { ppc_fp128, ppc_fp128 }* %agg.result, i32 0, i32 1
37+
// PPC32LNX-NEXT: store ppc_fp128 %{{.*}}, ppc_fp128* [[RETREAL]], align 16
38+
// PPC32LNX-NEXT: store ppc_fp128 %{{.*}}, ppc_fp128* [[RETIMAG]], align 16
39+
}

0 commit comments

Comments
 (0)