Debian Codegraph @

flang/test/Driver/lto-flags.f90

raw
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
5
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
11
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%}
16
17 ! RUN: %flang -### -flto=thin --target=powerpc64-aix %s 2>&1 | FileCheck %s \
18 ! RUN: --check-prefix THIN-LTO-LINKER-AIX
19
20 ! RUN: not %flang -### -S -flto=somelto %s 2>&1 | FileCheck %s --check-prefix=ERROR
21
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
26
27 ! NO-LTO: "-fc1"
28 ! NO-LTO-NOT: flto
29
30 ! FULL-LTO: "-fc1"
31 ! FULL-LTO-SAME: "-flto=full"
32
33 ! THIN-LTO-ALL: flang-new: 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"
38
39 ! ERROR: error: unsupported argument 'somelto' to option '-flto=