xref: /llvm-project/clang/test/Driver/global-isel.c (revision 12949c952c4fbad776a860c003ccf176973278a0)
1 // RUN: %clang -fglobal-isel -S -### %s 2>&1 | FileCheck --check-prefix=ENABLED %s
2 // RUN: %clang -fno-global-isel -S -### %s 2>&1 | FileCheck --check-prefix=DISABLED %s
3 
4 // RUN: %clang -target aarch64 -fglobal-isel -S %s -### 2>&1 | FileCheck --check-prefix=ARM64-DEFAULT %s
5 // RUN: %clang -target aarch64 -fglobal-isel -S -O0 %s -### 2>&1 | FileCheck --check-prefix=ARM64-O0 %s
6 // RUN: %clang -target aarch64 -fglobal-isel -S -O2 %s -### 2>&1 | FileCheck --check-prefix=ARM64-O2 %s
7 // RUN: %clang -target aarch64 -fglobal-isel -Wno-global-isel -S -O2 %s -### 2>&1 | FileCheck --check-prefix=ARM64-O2-NOWARN %s
8 
9 // RUN: %clang -target x86_64 -fglobal-isel -S %s -### 2>&1 | FileCheck --check-prefix=X86_64 %s
10 
11 // Now test the aliases.
12 
13 // RUN: %clang -fexperimental-isel -S -### %s 2>&1 | FileCheck --check-prefix=ENABLED %s
14 // RUN: %clang -fno-experimental-isel -S -### %s 2>&1 | FileCheck --check-prefix=DISABLED %s
15 
16 // RUN: %clang -target aarch64 -fexperimental-isel -S %s -### 2>&1 | FileCheck --check-prefix=ARM64-DEFAULT %s
17 // RUN: %clang -target aarch64 -fexperimental-isel -S -O0 %s -### 2>&1 | FileCheck --check-prefix=ARM64-O0 %s
18 // RUN: %clang -target aarch64 -fexperimental-isel -S -O2 %s -### 2>&1 | FileCheck --check-prefix=ARM64-O2 %s
19 
20 // RUN: %clang -target x86_64 -fexperimental-isel -S %s -### 2>&1 | FileCheck --check-prefix=X86_64 %s
21 
22 // ENABLED: "-mllvm" "-global-isel=1"
23 // DISABLED: "-mllvm" "-global-isel=0"
24 
25 // ARM64-DEFAULT-NOT: warning: -fglobal-isel
26 // ARM64-DEFAULT-NOT: "-global-isel-abort=2"
27 // ARM64-O0-NOT: warning: -fglobal-isel
28 // ARM64-O2: warning: -fglobal-isel support is incomplete for this architecture at the current optimization level
29 // ARM64-O2: "-mllvm" "-global-isel-abort=2"
30 // ARM64-O2-NOWARN-NOT: warning: -fglobal-isel
31 
32 // X86_64: -fglobal-isel support for the 'x86_64' architecture is incomplete
33 // X86_64: "-mllvm" "-global-isel-abort=2"
34