1*0a6a1f1dSLionel Sambuc // REQUIRES: powerpc-registered-target
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc // Verify ABI selection by the front end
4*0a6a1f1dSLionel Sambuc 
5*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s \
6*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck %s --check-prefix=CHECK-ELFv1
7*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s \
8*0a6a1f1dSLionel Sambuc // RUN:   -target-abi elfv1 | FileCheck %s --check-prefix=CHECK-ELFv1
9*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -emit-llvm -o - %s \
10*0a6a1f1dSLionel Sambuc // RUN:   -target-abi elfv2 | FileCheck %s --check-prefix=CHECK-ELFv2
11*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -emit-llvm -o - %s \
12*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck %s --check-prefix=CHECK-ELFv2
13*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -emit-llvm -o - %s \
14*0a6a1f1dSLionel Sambuc // RUN:   -target-abi elfv1 | FileCheck %s --check-prefix=CHECK-ELFv1
15*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -emit-llvm -o - %s \
16*0a6a1f1dSLionel Sambuc // RUN:   -target-abi elfv2 | FileCheck %s --check-prefix=CHECK-ELFv2
17*0a6a1f1dSLionel Sambuc 
18*0a6a1f1dSLionel Sambuc // CHECK-ELFv1: define void @func_fab(%struct.fab* noalias sret %agg.result, i64 %x.coerce)
19*0a6a1f1dSLionel Sambuc // CHECK-ELFv2: define [2 x float] @func_fab([2 x float] %x.coerce)
20*0a6a1f1dSLionel Sambuc struct fab { float a; float b; };
func_fab(struct fab x)21*0a6a1f1dSLionel Sambuc struct fab func_fab(struct fab x) { return x; }
22*0a6a1f1dSLionel Sambuc 
23*0a6a1f1dSLionel Sambuc // Verify ABI choice is passed on to the back end
24*0a6a1f1dSLionel Sambuc 
25*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -S -o - %s \
26*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck %s --check-prefix=CHECK-ASM-ELFv1
27*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -S -o - %s \
28*0a6a1f1dSLionel Sambuc // RUN:   -target-abi elfv1 | FileCheck %s --check-prefix=CHECK-ASM-ELFv1
29*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -S -o - %s \
30*0a6a1f1dSLionel Sambuc // RUN:   -target-abi elfv2 | FileCheck %s --check-prefix=CHECK-ASM-ELFv2
31*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -S -o - %s \
32*0a6a1f1dSLionel Sambuc // RUN:   | FileCheck %s --check-prefix=CHECK-ASM-ELFv2
33*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -S -o - %s \
34*0a6a1f1dSLionel Sambuc // RUN:   -target-abi elfv1 | FileCheck %s --check-prefix=CHECK-ASM-ELFv1
35*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -S -o - %s \
36*0a6a1f1dSLionel Sambuc // RUN:   -target-abi elfv2 | FileCheck %s --check-prefix=CHECK-ASM-ELFv2
37*0a6a1f1dSLionel Sambuc 
38*0a6a1f1dSLionel Sambuc // CHECK-ASM-ELFv2: .abiversion 2
39*0a6a1f1dSLionel Sambuc // CHECK-ASM-ELFv1-NOT: .abiversion 2
40*0a6a1f1dSLionel Sambuc 
41