46 lines · plain
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: system-linux4 5! RUN: not %flang %s -fcolor-diagnostics 2>&1 \6! RUN: | FileCheck %s --check-prefix=CHECK_CD7! RUN: not %flang %s -fno-color-diagnostics 2>&1 \8! RUN: | FileCheck %s --check-prefix=CHECK_NCD9! RUN: not %flang_fc1 %s -fcolor-diagnostics 2>&1 \10! RUN: | FileCheck %s --check-prefix=CHECK_CD11! RUN: not %flang_fc1 %s -fno-color-diagnostics 2>&1 \12! RUN: | FileCheck %s --check-prefix=UNSUPPORTED_COLOR_DIAGS13 14! RUN: not %flang %s -fdiagnostics-color 2>&1 \15! RUN: | FileCheck %s --check-prefix=CHECK_CD16! RUN: not %flang %s -fno-diagnostics-color 2>&1 \17! RUN: | FileCheck %s --check-prefix=CHECK_NCD18! RUN: not %flang_fc1 %s -fdiagnostics-color 2>&1 \19! RUN: | FileCheck %s --check-prefix=UNSUPPORTED_DIAGS_COLOR20! RUN: not %flang_fc1 %s -fno-diagnostics-color 2>&1 \21! RUN: | FileCheck %s --check-prefix=UNSUPPORTED_NO_DIAGS_COLOR22 23! RUN: not %flang %s -fdiagnostics-color=always 2>&1 \24! RUN: | FileCheck %s --check-prefix=CHECK_CD25! RUN: not %flang %s -fdiagnostics-color=never 2>&1 \26! RUN: | FileCheck %s --check-prefix=CHECK_NCD27 28! RUN: not %flang_fc1 %s 2>&1 | FileCheck %s --check-prefix=CHECK_NCD29 30! CHECK_CD: {{.*}}[0;1;31merror: {{.*}}[0m{{.*}}[1mSemantic errors in {{.*}}color-diagnostics.f90{{.*}}[0m31 32! CHECK_NCD: Semantic errors in {{.*}}color-diagnostics.f9033 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_BAD41! DCEQ_BAD: error: invalid argument 'sometimes' to -fdiagnostics-color=42 43program m44 integer :: i = k45end46