xref: /llvm-project/clang/test/Driver/aix-mcpu-default.c (revision cb1654ee4beedc875c25a95e7b98f1aaed0b9e35)
1 // Check that the target cpu defaults to power7 on AIX7.2 and up.
2 // RUN: %clang %s -### -c 2>&1 --target=powerpc-ibm-aix7.2 \
3 // RUN:   | FileCheck --check-prefix=CHECK-MCPU-DEFAULT-AIX72 %s
4 
5 // Check that the target cpu defaults to power7 on AIX7.2 and up.
6 // RUN: %clang %s -### -c 2>&1 --target=powerpc64-ibm-aix7.2 \
7 // RUN:   | FileCheck --check-prefix=CHECK-MCPU-DEFAULT-AIX72 %s
8 
9 // Check that the target cpu defaults to power7 on AIX7.1 and below.
10 // RUN: %clang %s -### -c 2>&1 --target=powerpc-ibm-aix7.1 \
11 // RUN:   | FileCheck --check-prefix=CHECK-MCPU-DEFAULT-AIX72 %s
12 
13 // Check that the target cpu defaults to power7 on AIX7.1 and below.
14 // RUN: %clang %s -### -c 2>&1 --target=powerpc64-ibm-aix7.1 \
15 // RUN:   | FileCheck --check-prefix=CHECK-MCPU-DEFAULT-AIX72 %s
16 
17 // Check that the target cpu defaults to power7 when level not specified.
18 // RUN: %clang %s -### -c 2>&1 --target=powerpc-ibm-aix \
19 // RUN:   | FileCheck --check-prefix=CHECK-MCPU-DEFAULT-AIX72 %s
20 
21 // Check that the target cpu defaults to power7 when level not specified.
22 // RUN: %clang %s -### -c 2>&1 --target=powerpc64-ibm-aix \
23 // RUN:   | FileCheck --check-prefix=CHECK-MCPU-DEFAULT-AIX72 %s
24 
25 // CHECK-MCPU-DEFAULT-AIX72-NOT: warning:
26 // CHECK-MCPU-DEFAULT-AIX72:     "-cc1"
27 // CHECK-MCPU-DEFAULT-AIX72:     "-target-cpu" "pwr7"
28 
29 // Check that the user is able to overwrite the default with '-mcpu'.
30 // RUN: %clang %s -### -c 2>&1 -mcpu=pwr6 --target=powerpc-ibm-aix \
31 // RUN:   | FileCheck --check-prefix=CHECK-MCPU-USER %s
32 // CHECK-MCPU-USER-NOT: warning:
33 // CHECK-MCPU-USER:     "-cc1"
34 // CHECK-MCPU-USER:     "-target-cpu" "pwr6"
35