Clang Project

clang_source_code/test/Driver/ppc-abi.c
1// Check passing PowerPC ABI options to the backend.
2
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=elfv1-qpx | FileCheck -check-prefix=CHECK-ELFv1-QPX %s
9// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
10// RUN:   -mcpu=a2q | FileCheck -check-prefix=CHECK-ELFv1-QPX %s
11// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
12// RUN:   -mcpu=a2 -mqpx | FileCheck -check-prefix=CHECK-ELFv1-QPX %s
13// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
14// RUN:   -mcpu=a2q -mno-qpx | FileCheck -check-prefix=CHECK-ELFv1 %s
15// RUN: %clang -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
16// RUN:   -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2-BE %s
17
18// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
19// RUN:   | FileCheck -check-prefix=CHECK-ELFv2 %s
20// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
21// RUN:   -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1-LE %s
22// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
23// RUN:   -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2 %s
24// RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
25// RUN:   -mabi=altivec | FileCheck -check-prefix=CHECK-ELFv2 %s
26
27// CHECK-ELFv1: "-mrelocation-model" "pic" "-pic-level" "2"
28// CHECK-ELFv1: "-target-abi" "elfv1"
29// CHECK-ELFv1-LE: "-mrelocation-model" "static"
30// CHECK-ELFv1-LE: "-target-abi" "elfv1"
31// CHECK-ELFv1-QPX: "-mrelocation-model" "pic" "-pic-level" "2"
32// CHECK-ELFv1-QPX: "-target-abi" "elfv1-qpx"
33// CHECK-ELFv2: "-mrelocation-model" "static"
34// CHECK-ELFv2: "-target-abi" "elfv2"
35// CHECK-ELFv2-BE: "-mrelocation-model" "pic" "-pic-level" "2"
36// CHECK-ELFv2-BE: "-target-abi" "elfv2"
37
38// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
39// RUN:   | FileCheck -check-prefix=CHECK-ELFv1-PIC %s
40// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
41// RUN:   -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1-PIC %s
42// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
43// RUN:   -mabi=elfv1-qpx | FileCheck -check-prefix=CHECK-ELFv1-QPX-PIC %s
44// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
45// RUN:   -mcpu=a2q | FileCheck -check-prefix=CHECK-ELFv1-QPX-PIC %s
46// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
47// RUN:   -mcpu=a2 -mqpx | FileCheck -check-prefix=CHECK-ELFv1-QPX-PIC %s
48// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
49// RUN:   -mcpu=a2q -mno-qpx | FileCheck -check-prefix=CHECK-ELFv1-PIC %s
50// RUN: %clang -fPIC -target powerpc64-unknown-linux-gnu %s -### -o %t.o 2>&1 \
51// RUN:   -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2-PIC %s
52
53// RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
54// RUN:   | FileCheck -check-prefix=CHECK-ELFv2-PIC %s
55// RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
56// RUN:   -mabi=elfv1 | FileCheck -check-prefix=CHECK-ELFv1-PIC %s
57// RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
58// RUN:   -mabi=elfv2 | FileCheck -check-prefix=CHECK-ELFv2-PIC %s
59// RUN: %clang -fPIC -target powerpc64le-unknown-linux-gnu %s -### -o %t.o 2>&1 \
60// RUN:   -mabi=altivec | FileCheck -check-prefix=CHECK-ELFv2-PIC %s
61
62// CHECK-ELFv1-PIC: "-mrelocation-model" "pic" "-pic-level" "2"
63// CHECK-ELFv1-PIC: "-target-abi" "elfv1"
64// CHECK-ELFv1-QPX-PIC: "-mrelocation-model" "pic" "-pic-level" "2"
65// CHECK-ELFv1-QPX-PIC: "-target-abi" "elfv1-qpx"
66// CHECK-ELFv2-PIC: "-mrelocation-model" "pic" "-pic-level" "2"
67// CHECK-ELFv2-PIC: "-target-abi" "elfv2"
68
69
70