File: color-diagnostics.c

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (57 lines) | stat: -rw-r--r-- 2,538 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// RUN: %clang -fcolor-diagnostics -### -c %s 2>&1 \
// RUN:     | FileCheck --check-prefix=CHECK-CD %s
// CHECK-CD: "-cc1"{{.*}} "-fcolor-diagnostics"

// RUN: %clang -fno-color-diagnostics -### -c %s 2>&1 \
// RUN:     | FileCheck --check-prefix=CHECK-NCD %s
// CHECK-NCD-NOT: "-cc1"{{.*}} "-fcolor-diagnostics"

// RUN: %clang -fdiagnostics-color -### -c %s 2>&1 \
// RUN:     | FileCheck --check-prefix=CHECK-DC %s
// CHECK-DC: "-cc1"{{.*}} "-fcolor-diagnostics"

// RUN: %clang -fno-diagnostics-color -### -c %s 2>&1 \
// RUN:     | FileCheck --check-prefix=CHECK-NDC %s
// CHECK-NDC-NOT: "-cc1"{{.*}} "-fcolor-diagnostics"

// RUN: %clang -fdiagnostics-color=always -### -c %s 2>&1 \
// RUN:     | FileCheck --check-prefix=CHECK-DCE_A %s
// CHECK-DCE_A: "-cc1"{{.*}} "-fcolor-diagnostics"

// RUN: %clang -fdiagnostics-color=never -### -c %s 2>&1 \
// RUN:     | FileCheck --check-prefix=CHECK-DCE_N %s
// CHECK-DCE_N-NOT: "-cc1"{{.*}} "-fcolor-diagnostics"

// The test doesn't run in a PTY, so "auto" defaults to off.
// RUN: %clang -fdiagnostics-color=auto -### -c %s 2>&1 \
// RUN:     | FileCheck --check-prefix=CHECK-DCE_AUTO %s
// CHECK-DCE_AUTO-NOT: "-cc1"{{.*}} "-fcolor-diagnostics"

// RUN: %clang -fdiagnostics-color=foo -### -c %s 2>&1 \
// RUN:     | FileCheck --check-prefix=CHECK-DCE_FOO %s
// CHECK-DCE_FOO: error: invalid argument 'foo' to -fdiagnostics-color=

// Check that the last flag wins.
// RUN: %clang -fno-color-diagnostics -fdiagnostics-color -### -c %s 2>&1 \
// RUN:     | FileCheck --check-prefix=CHECK-NCD_DC_S %s
// CHECK-NCD_DC_S: "-cc1"{{.*}} "-fcolor-diagnostics"

// RUN: %clang -fcolor-diagnostics -fno-diagnostics-color -### -c %s 2>&1 \
// RUN:     | FileCheck --check-prefix=CHECK-CD_NDC_S %s
// CHECK-CD_NDC_S-NOT: "-cc1"{{.*}} "-fcolor-diagnostics"

// RUN: %clang -fdiagnostics-color -fno-color-diagnostics -### -c %s 2>&1 \
// RUN:     | FileCheck --check-prefix=CHECK-DC_NCD_S %s
// CHECK-DC_NCD_S-NOT: "-cc1"{{.*}} "-fcolor-diagnostics"

// RUN: %clang -fno-diagnostics-color -fcolor-diagnostics -### -c %s 2>&1 \
// RUN:     | FileCheck --check-prefix=CHECK-NDC_CD_S %s
// CHECK-NDC_CD_S: "-cc1"{{.*}} "-fcolor-diagnostics"

// RUN: %clang -fcolor-diagnostics -fdiagnostics-color=auto -### -c %s 2>&1 \
// RUN:     | FileCheck --check-prefix=CHECK-CD_DCE_AUTO_S %s
// CHECK-CD_DCE_AUTO_S-NOT: "-cc1"{{.*}} "-fcolor-diagnostics"

// RUN: %clang -fansi-escape-codes -### -c %s 2>&1 \
// RUN:     | FileCheck --check-prefix=CHECK-AEC %s
// CHECK-AEC: "-cc1"{{.*}} "-fansi-escape-codes"