[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / Driver / ppc-abi.c
bloba433f4c0f5d8fc2c70be5e40b1302653f160b7b3
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
18 // RUN: %clang --target=ppc64 -mabi=elfv1 %s -### -o %t.o 2>&1 \
19 // RUN: | FileCheck -check-prefix=CHECK-UNKNOWN-ELFv1 %s
20 // RUN: %clang --target=ppc64 -mabi=elfv2 %s -### -o %t.o 2>&1 \
21 // RUN: | FileCheck -check-prefix=CHECK-UNKNOWN-ELFv2 %s
23 // RUN: %clang -target powerpc64-unknown-freebsd11 %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv1 %s
24 // RUN: %clang -target powerpc64-unknown-freebsd12 %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv1 %s
25 // RUN: %clang -target powerpc64-unknown-freebsd13 %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv2-BE %s
26 // RUN: %clang -target powerpc64-unknown-freebsd14 %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv2-BE %s
27 // RUN: %clang -target powerpc64-unknown-freebsd %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv2-BE %s
28 // RUN: %clang -target powerpc64le-unknown-freebsd13 %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv2 %s
29 // RUN: %clang -target powerpc64-unknown-openbsd %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv2-BE-PIE %s
30 // RUN: %clang -target powerpc64-linux-musl %s -### 2>&1 | FileCheck --check-prefix=CHECK-ELFv2-BE-PIE %s
32 // CHECK-ELFv1: "-target-abi" "elfv1"
33 // CHECK-ELFv1-LE: "-target-abi" "elfv1"
34 // CHECK-ELFv2: "-target-abi" "elfv2"
35 // CHECK-ELFv2-BE: "-target-abi" "elfv2"
36 // CHECK-ELFv2-BE-PIE: "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie"
37 // CHECK-ELFv2-BE-PIE: "-target-abi" "elfv2"
38 // CHECK-UNKNOWN-ELFv1: "-target-abi" "elfv1"
39 // CHECK-UNKNOWN-ELFv2: "-target-abi" "elfv2"
41 // RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
42 // RUN: | FileCheck -check-prefix=CHECK-ELFv1-PIC %s
43 // RUN: %clang -fPIC -target powerpc64-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 powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
46 // RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2-PIC %s
48 // RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
49 // RUN: | FileCheck -check-prefix=CHECK-ELFv2-PIC %s
50 // RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
51 // RUN: -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1-PIC %s
52 // RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
53 // RUN: -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2-PIC %s
54 // RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
55 // RUN: -mabi=altivec | FileCheck -check-prefix=CHECK-ELFv2-PIC %s
57 // CHECK-ELFv1-PIC: "-mrelocation-model" "pic" "-pic-level" "2"
58 // CHECK-ELFv1-PIC: "-target-abi" "elfv1"
59 // CHECK-ELFv2-PIC: "-mrelocation-model" "pic" "-pic-level" "2"
60 // CHECK-ELFv2-PIC: "-target-abi" "elfv2"
62 // Check -mabi=ieeelongdouble is passed through but it does not change -target-abi.
63 // RUN: %clang -target powerpc64le-linux-gnu %s -mabi=ieeelongdouble -mabi=elfv1 -### 2>&1 \
64 // RUN: | FileCheck -check-prefix=CHECK-ELFv1-IEEE %s
65 // RUN: %clang -target powerpc64le-linux-gnu %s -mabi=elfv1 -mabi=ieeelongdouble -### 2>&1 \
66 // RUN: | FileCheck -check-prefix=CHECK-ELFv1-IEEE %s
67 // RUN: %clang -target powerpc64le-linux-gnu %s -mabi=elfv2 -mabi=elfv1 -mabi=ibmlongdouble -mabi=ieeelongdouble -### 2>&1 \
68 // RUN: | FileCheck -check-prefix=CHECK-ELFv1-IEEE %s
70 // CHECK-ELFv1-IEEE: "-mabi=ieeelongdouble"
71 // CHECK-ELFv1-IEEE: "-target-abi" "elfv1"
73 // RUN: %clang -target powerpc64le-linux-gnu %s -mabi=ibmlongdouble -### 2>&1 \
74 // RUN: | FileCheck -check-prefix=CHECK-ELFv2-IBM128 %s
76 // CHECK-ELFv2-IBM128-NOT: "-mabi=ieeelongdouble"
77 // CHECK-ELFv2-IBM128: "-target-abi" "elfv2"