1 // Check passing PowerPC ABI options to the backend.
3 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
4 // RUN: | FileCheck -check-prefix=CHECK-ELFv1 %s
5 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
6 // RUN: -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1 %s
7 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
8 // RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2-BE %s
10 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
11 // RUN: | FileCheck -check-prefix=CHECK-ELFv2 %s
12 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
13 // RUN: -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1-LE %s
14 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
15 // RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2 %s
16 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
17 // RUN: -mabi=altivec | FileCheck -check-prefix=CHECK-ELFv2 %s
19 // RUN: %clang -target powerpc64-unknown-freebsd11 %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv1 %s
20 // RUN: %clang -target powerpc64-unknown-freebsd12 %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv1 %s
21 // RUN: %clang -target powerpc64-unknown-freebsd13 %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv2-BE %s
22 // RUN: %clang -target powerpc64-unknown-freebsd14 %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv2-BE %s
23 // RUN: %clang -target powerpc64le-unknown-freebsd13 %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv2 %s
24 // RUN: %clang -target powerpc64-unknown-openbsd %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv2-BE-PIE %s
25 // RUN: %clang -target powerpc64-linux-musl %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv2-BE-PIE %s
27 // CHECK-ELFv1: "-target-abi" "elfv1"
28 // CHECK-ELFv1-LE: "-target-abi" "elfv1"
29 // CHECK-ELFv2: "-target-abi" "elfv2"
30 // CHECK-ELFv2-BE: "-target-abi" "elfv2"
31 // CHECK-ELFv2-BE-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie"
32 // CHECK-ELFv2-BE-PIE: "-target-abi" "elfv2"
34 // RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
35 // RUN: | FileCheck -check-prefix=CHECK-ELFv1-PIC %s
36 // RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
37 // RUN: -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1-PIC %s
38 // RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
39 // RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2-PIC %s
41 // RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
42 // RUN: | FileCheck -check-prefix=CHECK-ELFv2-PIC %s
43 // RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
44 // RUN: -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1-PIC %s
45 // RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
46 // RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2-PIC %s
47 // RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
48 // RUN: -mabi=altivec | FileCheck -check-prefix=CHECK-ELFv2-PIC %s
50 // CHECK-ELFv1-PIC: "-mrelocation-model" "pic" "-pic-level" "2"
51 // CHECK-ELFv1-PIC: "-target-abi" "elfv1"
52 // CHECK-ELFv2-PIC: "-mrelocation-model" "pic" "-pic-level" "2"
53 // CHECK-ELFv2-PIC: "-target-abi" "elfv2"
55 // Check -mabi=ieeelongdouble is passed through but it does not change -target-abi.
56 // RUN: %clang -target powerpc64le-linux-gnu %s -mabi=ieeelongdouble -mabi=elfv1 -### 2>&1 \
57 // RUN: | FileCheck -check-prefix=CHECK-ELFv1-IEEE %s
58 // RUN: %clang -target powerpc64le-linux-gnu %s -mabi=elfv1 -mabi=ieeelongdouble -### 2>&1 \
59 // RUN: | FileCheck -check-prefix=CHECK-ELFv1-IEEE %s
60 // RUN: %clang -target powerpc64le-linux-gnu %s -mabi=elfv2 -mabi=elfv1 -mabi=ibmlongdouble -mabi=ieeelongdouble -### 2>&1 \
61 // RUN: | FileCheck -check-prefix=CHECK-ELFv1-IEEE %s
63 // CHECK-ELFv1-IEEE: "-mabi=ieeelongdouble"
64 // CHECK-ELFv1-IEEE: "-target-abi" "elfv1"
66 // RUN: %clang -target powerpc64le-linux-gnu %s -mabi=ibmlongdouble -### 2>&1 \
67 // RUN: | FileCheck -check-prefix=CHECK-ELFv2-IBM128 %s
69 // CHECK-ELFv2-IBM128-NOT: "-mabi=ieeelongdouble"
70 // CHECK-ELFv2-IBM128: "-target-abi" "elfv2"