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