[LLVM] Fix Maintainers.md formatting (NFC)
[llvm-project.git] / flang / test / Driver / color-diagnostics-forwarding.f90
blob29061242cb0cbc081bc0ded7ac5bd7b39aa88b36
1 ! Test that flang forwards -f{no-}color-diagnostics and
2 ! -f{no-}diagnostics-color options to flang -fc1 as expected.
4 ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fcolor-diagnostics \
5 ! RUN: | FileCheck %s --check-prefix=CHECK-CD
6 ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fdiagnostics-color \
7 ! RUN: | FileCheck %s --check-prefix=CHECK-CD
8 ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fdiagnostics-color=always \
9 ! RUN: | FileCheck %s --check-prefix=CHECK-CD
10 ! CHECK-CD: "-fc1"{{.*}} "-fcolor-diagnostics"
12 ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fno-color-diagnostics \
13 ! RUN: | FileCheck %s --check-prefix=CHECK-NCD
14 ! RUN: %flang -fsyntax-only -### %s -o %t -fno-diagnostics-color 2>&1 \
15 ! RUN: | FileCheck %s --check-prefix=CHECK-NCD
16 ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 -fdiagnostics-color=never \
17 ! RUN: | FileCheck %s --check-prefix=CHECK-NCD
18 ! CHECK-NCD-NOT: "-fc1"{{.*}} "-fcolor-diagnostics"
20 ! Check that the last flag wins.
21 ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 \
22 ! RUN: -fno-color-diagnostics -fcolor-diagnostics \
23 ! RUN: | FileCheck %s --check-prefix=CHECK-NCD_CD_S
24 ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 \
25 ! RUN: -fno-diagnostics-color -fdiagnostics-color \
26 ! RUN: | FileCheck %s --check-prefix=CHECK-NCD_CD_S
27 ! RUN: %flang -fsyntax-only -### %s -o %t \
28 ! RUN: -fno-color-diagnostics -fdiagnostics-color=always 2>&1 \
29 ! RUN: | FileCheck %s --check-prefix=CHECK-NCD_CD_S
30 ! RUN: %flang -fsyntax-only -### %s -o %t \
31 ! RUN: -fdiagnostics-color=never -fdiagnostics-color=always 2>&1 \
32 ! RUN: | FileCheck %s --check-prefix=CHECK-NCD_CD_S
33 ! RUN: %flang -fsyntax-only -### %s -o %t \
34 ! RUN: -fdiagnostics-color=never -fcolor-diagnostics 2>&1 \
35 ! RUN: | FileCheck %s --check-prefix=CHECK-NCD_CD_S
36 ! CHECK-NCD_CD_S: "-fc1"{{.*}} "-fcolor-diagnostics"
38 ! RUN: %flang -fsyntax-only -### %s -o %t 2>&1 \
39 ! RUN: -fcolor-diagnostics -fno-color-diagnostics \
40 ! RUN: | FileCheck %s --check-prefix=CHECK-CD_NCD_S
41 ! RUN: %flang -fsyntax-only -### %s -o %t \
42 ! RUN: -fdiagnostics-color -fno-diagnostics-color 2>&1 \
43 ! RUN: | FileCheck %s --check-prefix=CHECK-CD_NCD_S
44 ! RUN: %flang -fsyntax-only -### %s -o %t \
45 ! RUN: -fdiagnostics-color=always -fno-color-diagnostics 2>&1 \
46 ! RUN: | FileCheck %s --check-prefix=CHECK-CD_NCD_S
47 ! RUN: %flang -fsyntax-only -### %s -o %t \
48 ! RUN: -fdiagnostics-color=always -fdiagnostics-color=never 2>&1 \
49 ! RUN: | FileCheck %s --check-prefix=CHECK-CD_NCD_S
50 ! RUN: %flang -fsyntax-only -### %s -o %t \
51 ! RUN: -fcolor-diagnostics -fdiagnostics-color=never 2>&1 \
52 ! RUN: | FileCheck %s --check-prefix=CHECK-CD_NCD_S
53 ! CHECK-CD_NCD_S-NOT: "-fc1"{{.*}} "-fcolor-diagnostics"