1 ! Solaris ld doesn't support the linker plugin interface
2 ! UNSUPPORTED: system-windows, system-solaris
3 ! RUN: %flang -### -S %s 2>&1 | FileCheck %s --check-prefix=NO-LTO
4 ! RUN: %flang -### -S -fno-lto %s 2>&1 | FileCheck %s --check-prefix=NO-LTO
6 ! Full LTO and aliases.
7 ! RUN: %flang -### -S -flto %s 2>&1 | FileCheck %s --check-prefix=FULL-LTO
8 ! RUN: %flang -### -S -flto=full %s 2>&1 | FileCheck %s --check-prefix=FULL-LTO
9 ! RUN: %flang -### -S -flto=auto %s 2>&1 | FileCheck %s --check-prefix=FULL-LTO
10 ! RUN: %flang -### -S -flto=jobserver %s 2>&1 | FileCheck %s --check-prefix=FULL-LTO
12 ! Also check linker plugin opt for Thin LTO
13 ! RUN: %flang -### -flto=thin %s 2>&1 | FileCheck %s \
14 ! RUN: --check-prefixes=%if system-darwin || system-aix %{THIN-LTO-ALL%} \
15 ! RUN: %else %{THIN-LTO-ALL,THIN-LTO-LINKER-PLUGIN%}
17 ! RUN: %flang -### -flto=thin --target=powerpc64-aix %s 2>&1 | FileCheck %s \
18 ! RUN: --check-prefix THIN-LTO-LINKER-AIX
20 ! RUN: not %flang -### -S -flto=somelto %s 2>&1 | FileCheck %s --check-prefix=ERROR
22 ! FC1 tests. Check that it does not crash.
23 ! RUN: %flang_fc1 -S %s -flto -o /dev/null
24 ! RUN: %flang_fc1 -S %s -flto=full -o /dev/null
25 ! RUN: %flang_fc1 -S %s -flto=thin -o /dev/null
31 ! FULL-LTO-SAME: "-flto=full"
33 ! THIN-LTO-ALL: flang{{.*}}: warning: the option '-flto=thin' is a work in progress
34 ! THIN-LTO-ALL: "-fc1"
35 ! THIN-LTO-ALL-SAME: "-flto=thin"
36 ! THIN-LTO-LINKER-PLUGIN: "-plugin-opt=thinlto"
37 ! THIN-LTO-LINKER-AIX: "-bdbg:thinlto"
39 ! ERROR: error: unsupported argument 'somelto' to option '-flto=