File: no-stale-modtime.m

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (42 lines) | stat: -rw-r--r-- 1,789 bytes parent folder | download | duplicates (21)
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
// Ensure that when rebuilding a module we don't save its old modtime when
// building modules that depend on it.

// RUN: rm -rf %t
// RUN: mkdir -p %t
// This could be replaced by diamond_*, except we want to modify the top header
// RUN: echo '@import l; @import r;' > %t/b.h
// RUN: echo '@import t; // fromt l' > %t/l.h
// RUN: echo '@import t; // fromt r' > %t/r.h

// RUN: echo '// top' > %t/t.h-1
// RUN: cat %t/t.h-1 > %t/t.h

// RUN: echo 'module b { header "b.h" } module l { header "l.h" }' > %t/module.map-1
// RUN: echo 'module r { header "r.h" } module t { header "t.h" }' > %t/module.map-2
// RUN: cat %t/module.map-1 %t/module.map-2 > %t/module.map

// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
// RUN:     -I %t -fsyntax-only %s -Rmodule-build 2>&1 \
// RUN: | FileCheck -check-prefix=REBUILD-ALL %s
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
// RUN:     -I %t -fsyntax-only %s -Rmodule-build -verify

// Add an identifier to ensure everything depending on t is out of date
// RUN: echo 'extern int a;' > %t/t.h-2
// RUN: cat %t/t.h-1 %t/t.h-2 > %t/t.h

// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
// RUN:     -I %t -fsyntax-only %s -Rmodule-build 2>&1 \
// RUN: | FileCheck -check-prefix=REBUILD-ALL %s
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
// RUN:     -I %t -fsyntax-only %s -Rmodule-build -verify

// REBUILD-ALL: building module 'b'
// REBUILD-ALL: building module 'l'
// REBUILD-ALL: building module 't'
// REBUILD-ALL: building module 'r'

// Use -verify when expecting no modules to be rebuilt.
// expected-no-diagnostics

@import b;