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