xref: /llvm-project/clang/test/Driver/ppc-crbits.cpp (revision 2534dc120a4c9468d9a0044665a50361089f0a4d)
1 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -mcpu=pwr10 \
2 // RUN:   -mcrbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CRBITS %s
3 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -mcpu=pwr10 \
4 // RUN:   -mno-crbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s
5 
6 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -mcpu=pwr9 \
7 // RUN:   -mcrbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CRBITS %s
8 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -mcpu=pwr9 \
9 // RUN:   -mno-crbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s
10 
11 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -mcpu=pwr8 \
12 // RUN:   -mcrbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CRBITS %s
13 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -mcpu=pwr8 \
14 // RUN:   -mno-crbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s
15 
16 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -mcpu=pwr7 \
17 // RUN:   -mcrbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CRBITS %s
18 // RUN: %clang -target powerpc64le-unknown-linux-gnu %s -### -mcpu=pwr7 \
19 // RUN:   -mno-crbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s
20 
21 // RUN: %clang -target powerpc-ibm-aix %s -### -mcpu=pwr10 \
22 // RUN:   -mcrbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CRBITS %s
23 // RUN: %clang -target powerpc-ibm-aix %s -### -mcpu=pwr10 \
24 // RUN:   -mno-crbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s
25 
26 // RUN: %clang -target powerpc-ibm-aix %s -### -mcpu=pwr9 \
27 // RUN:   -mcrbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CRBITS %s
28 // RUN: %clang -target powerpc-ibm-aix %s -### -mcpu=pwr9 \
29 // RUN:   -mno-crbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s
30 
31 // RUN: %clang -target powerpc-ibm-aix %s -### -mcpu=pwr8 \
32 // RUN:   -mcrbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CRBITS %s
33 // RUN: %clang -target powerpc-ibm-aix %s -### -mcpu=pwr8 \
34 // RUN:   -mno-crbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s
35 
36 // RUN: %clang -target powerpc-ibm-aix %s -### -mcpu=pwr7 \
37 // RUN:   -mcrbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CRBITS %s
38 // RUN: %clang -target powerpc-ibm-aix %s -### -mcpu=pwr7 \
39 // RUN:   -mno-crbits -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s
40 
41 
42 // CHECK-NOCRBITS: "-target-feature" "-crbits"
43 // CHECK-CRBITS: "-target-feature" "+crbits"
44 
45 
46 // RUN: %clang -target powerpc64le-unknown-linux-gnu -mcpu=pwr10 -emit-llvm \
47 // RUN:   -S %s -o - | FileCheck %s --check-prefix=HAS-CRBITS
48 // RUN: %clang -target powerpc64le-unknown-linux-gnu -mcpu=pwr10 -mcrbits \
49 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-CRBITS
50 // RUN: %clang -target powerpc64le-unknown-linux-gnu -mcpu=pwr10 -mno-crbits \
51 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-NOCRBITS
52 
53 // RUN: %clang -target powerpc64le-unknown-linux-gnu -mcpu=pwr9 -emit-llvm \
54 // RUN:   -S %s -o - | FileCheck %s --check-prefix=HAS-CRBITS
55 // RUN: %clang -target powerpc64le-unknown-linux-gnu -mcpu=pwr9 -mcrbits \
56 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-CRBITS
57 // RUN: %clang -target powerpc64le-unknown-linux-gnu -mcpu=pwr9 -mno-crbits \
58 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-NOCRBITS
59 
60 // RUN: %clang -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -emit-llvm \
61 // RUN:   -S %s -o - | FileCheck %s --check-prefix=HAS-CRBITS
62 // RUN: %clang -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -mcrbits \
63 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-CRBITS
64 // RUN: %clang -target powerpc64le-unknown-linux-gnu -mcpu=pwr8 -mno-crbits \
65 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-NOCRBITS
66 
67 // RUN: %clang -target powerpc64le-unknown-linux-gnu -mcpu=pwr7 -emit-llvm \
68 // RUN:   -S %s -o - | FileCheck %s --check-prefix=HAS-NOCRBITS
69 // RUN: %clang -target powerpc64le-unknown-linux-gnu -mcpu=pwr7 -mcrbits \
70 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-CRBITS
71 // RUN: %clang -target powerpc64le-unknown-linux-gnu -mcpu=pwr7 -mno-crbits \
72 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-NOCRBITS
73 
74 // RUN: %clang -target powerpc-ibm-aix -mcpu=pwr10 -emit-llvm \
75 // RUN:   -S %s -o - | FileCheck %s --check-prefix=HAS-CRBITS
76 // RUN: %clang -target powerpc-ibm-aix -mcpu=pwr10 -mcrbits \
77 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-CRBITS
78 // RUN: %clang -target powerpc-ibm-aix -mcpu=pwr10 -mno-crbits \
79 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-NOCRBITS
80 
81 // RUN: %clang -target powerpc-ibm-aix -mcpu=pwr9 -emit-llvm \
82 // RUN:   -S %s -o - | FileCheck %s --check-prefix=HAS-CRBITS
83 // RUN: %clang -target powerpc-ibm-aix -mcpu=pwr9 -mcrbits \
84 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-CRBITS
85 // RUN: %clang -target powerpc-ibm-aix -mcpu=pwr9 -mno-crbits \
86 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-NOCRBITS
87 
88 // RUN: %clang -target powerpc-ibm-aix -mcpu=pwr8 -emit-llvm \
89 // RUN:   -S %s -o - | FileCheck %s --check-prefix=HAS-CRBITS
90 // RUN: %clang -target powerpc-ibm-aix -mcpu=pwr8 -mcrbits \
91 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-CRBITS
92 // RUN: %clang -target powerpc-ibm-aix -mcpu=pwr8 -mno-crbits \
93 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-NOCRBITS
94 
95 // RUN: %clang -target powerpc-ibm-aix -mcpu=pwr7 -emit-llvm \
96 // RUN:   -S %s -o - | FileCheck %s --check-prefix=HAS-NOCRBITS
97 // RUN: %clang -target powerpc-ibm-aix -mcpu=pwr7 -mcrbits \
98 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-CRBITS
99 // RUN: %clang -target powerpc-ibm-aix -mcpu=pwr7 -mno-crbits \
100 // RUN:   -emit-llvm -S %s -o - | FileCheck %s --check-prefix=HAS-NOCRBITS
101 
102 
103 // HAS-CRBITS: main(
104 // HAS-CRBITS: attributes #0 = {
105 // HAS-CRBITS-SAME: +crbits
106 // HAS-NOCRBITS: main(
107 // HAS-NOCRBITS: attributes #0 = {
108 // HAS-NOCRBITS-SAME: -crbits
109 
main(int argc,char * argv[])110 int main(int argc, char *argv[]) {
111   return 0;
112 }
113