File: fcache-compile-job-serialized-diagnostics.c

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (63 lines) | stat: -rw-r--r-- 2,953 bytes parent folder | download
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
58
59
60
61
62
63
// RUN: rm -rf %t && mkdir -p %t
// RUN: llvm-cas --cas %t/cas --ingest %s > %t/casid

// RUN: %clang -cc1 -triple x86_64-apple-macos11 -fcas-path %t/cas \
// RUN:   -fcas-fs @%t/casid -fcache-compile-job \
// RUN:   -Wimplicit-function-declaration \
// RUN:   -Wno-error=implicit-function-declaration \
// RUN:   -Rcompile-job-cache -emit-obj -o %t/output.o \
// RUN:   -serialize-diagnostic-file %t/diags %s 2>&1 \
// RUN:   | FileCheck %s --allow-empty --check-prefix=CACHE-MISS

// RUN: c-index-test -read-diagnostics %t/diags 2>&1 | FileCheck %s --check-prefix=SERIALIZED-MISS --check-prefix=SERIALIZED-COMMON

// RUN: ls %t/output.o && rm %t/output.o

// RUN: %clang -cc1 -triple x86_64-apple-macos11 -fcas-path %t/cas \
// RUN:   -fcas-fs @%t/casid -fcache-compile-job \
// RUN:   -Wimplicit-function-declaration \
// RUN:   -Wno-error=implicit-function-declaration \
// RUN:   -Rcompile-job-cache -emit-obj -o %t/output.o \
// RUN:   -serialize-diagnostic-file %t/diags %s 2>&1 \
// RUN:   | FileCheck %s --check-prefix=CACHE-HIT

// RUN: c-index-test -read-diagnostics %t/diags 2>&1 | FileCheck %s --check-prefix=SERIALIZED-HIT --check-prefix=SERIALIZED-COMMON

// CACHE-HIT: remark: compile job cache hit
// CACHE-HIT: warning: some warning

// CACHE-MISS: remark: compile job cache miss
// CACHE-MISS: warning: some warning

// SERIALIZED-HIT: warning: compile job cache hit
// SERIALIZED-MISS: warning: compile job cache miss
// SERIALIZED-COMMON: warning: some warning
// SERIALIZED-COMMON: Number of diagnostics: 2

// Make sure warnings are merged with driver ones.
// Using normal compilation as baseline.
// RUN: %clang -target x86_64-apple-macos11 -c %s -o %t/t.o -Wl,-none --serialize-diagnostics %t/t1.diag \
// RUN:   2>&1 | FileCheck %s -check-prefix=WARN
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas CLANG_CACHE_USE_CASFS_DEPSCAN=1 %clang-cache \
// RUN:   %clang -target x86_64-apple-macos11 -c %s -o %t/t.o -Wl,-none --serialize-diagnostics %t/t2.diag \
// RUN:   2>&1 | FileCheck %s -check-prefix=WARN
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas %clang-cache \
// RUN:   %clang -target x86_64-apple-macos11 -c %s -o %t/t.o -Wl,-none --serialize-diagnostics %t/t2.inc.diag \
// RUN:   2>&1 | FileCheck %s -check-prefix=WARN
// RUN: diff %t/t1.diag %t/t2.diag
// RUN: diff %t/t1.diag %t/t2.inc.diag

// Try again with cache hit.
// RUN: rm %t/t2.diag
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas CLANG_CACHE_USE_CASFS_DEPSCAN=1 %clang-cache \
// RUN:   %clang -target x86_64-apple-macos11 -c %s -o %t/t.o -Wl,-none --serialize-diagnostics %t/t2.diag
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas %clang-cache \
// RUN:   %clang -target x86_64-apple-macos11 -c %s -o %t/t.o -Wl,-none --serialize-diagnostics %t/t2.inc.diag \
// RUN:   2>&1 | FileCheck %s -check-prefix=WARN
// RUN: diff %t/t1.diag %t/t2.diag
// RUN: diff %t/t1.diag %t/t2.inc.diag

// WARN: warning: -Wl,-none: 'linker' input unused
// WARN: warning: some warning

#warning some warning