1! Test the behaviors of -f{no-}color-diagnostics and -f{no}-diagnostics-color. 2! Windows command prompt doesn't support ANSI escape sequences. 3! REQUIRES: shell 4 5! RUN: not %flang %s -fcolor-diagnostics 2>&1 \ 6! RUN: | FileCheck %s --check-prefix=CHECK_CD 7! RUN: not %flang %s -fno-color-diagnostics 2>&1 \ 8! RUN: | FileCheck %s --check-prefix=CHECK_NCD 9! RUN: not %flang_fc1 %s -fcolor-diagnostics 2>&1 \ 10! RUN: | FileCheck %s --check-prefix=CHECK_CD 11! RUN: not %flang_fc1 %s -fno-color-diagnostics 2>&1 \ 12! RUN: | FileCheck %s --check-prefix=UNSUPPORTED_COLOR_DIAGS 13 14! RUN: not %flang %s -fdiagnostics-color 2>&1 \ 15! RUN: | FileCheck %s --check-prefix=CHECK_CD 16! RUN: not %flang %s -fno-diagnostics-color 2>&1 \ 17! RUN: | FileCheck %s --check-prefix=CHECK_NCD 18! RUN: not %flang_fc1 %s -fdiagnostics-color 2>&1 \ 19! RUN: | FileCheck %s --check-prefix=UNSUPPORTED_DIAGS_COLOR 20! RUN: not %flang_fc1 %s -fno-diagnostics-color 2>&1 \ 21! RUN: | FileCheck %s --check-prefix=UNSUPPORTED_NO_DIAGS_COLOR 22 23! RUN: not %flang %s -fdiagnostics-color=always 2>&1 \ 24! RUN: | FileCheck %s --check-prefix=CHECK_CD 25! RUN: not %flang %s -fdiagnostics-color=never 2>&1 \ 26! RUN: | FileCheck %s --check-prefix=CHECK_NCD 27 28! RUN: not %flang_fc1 %s 2>&1 | FileCheck %s --check-prefix=CHECK_NCD 29 30! CHECK_CD: {{.*}}[0;1;31merror: {{.*}}[0m{{.*}}[1mSemantic errors in {{.*}}color-diagnostics.f90{{.*}}[0m 31 32! CHECK_NCD: Semantic errors in {{.*}}color-diagnostics.f90 33 34! UNSUPPORTED_COLOR_DIAGS: error: unknown argument: '-fno-color-diagnostics' 35! UNSUPPORTED_DIAGS_COLOR: error: unknown argument: '-fdiagnostics-color' 36! UNSUPPORTED_NO_DIAGS_COLOR: error: unknown argument: '-fno-diagnostics-color' 37 38! Check that invalid values of -fdiagnostics-color= are disallowed. 39! RUN: not %flang %s -fdiagnostics-color=sometimes 2>&1 \ 40! RUN: | FileCheck %s --check-prefix=DCEQ_BAD 41! DCEQ_BAD: error: invalid argument 'sometimes' to -fdiagnostics-color= 42 43program m 44 integer :: i = k 45end 46