|
| 1 | +// ============================================================================= |
| 2 | +// Without private dependencies |
| 3 | +// ============================================================================= |
| 4 | + |
| 5 | +// Establish status quo |
| 6 | + |
| 7 | +// RUN: %empty-directory(%t) |
| 8 | +// RUN: cp %S/Inputs/superfluous-cascade/* %t |
| 9 | +// RUN: cp %t/definesPoint{-before,}.swift |
| 10 | +// RUN: touch -t 200101010101 %t/*.swift |
| 11 | + |
| 12 | +// RUN: cd %t && %swiftc_driver -enable-batch-mode -j2 -incremental -driver-show-incremental main.swift definesPoint.swift usesPoint.swift usesDisplay.swift -module-name main -output-file-map ofm.json >&output1 |
| 13 | + |
| 14 | +// Change one type - the cascading edge causes us to rebuild everything but main |
| 15 | + |
| 16 | +// RUN: cp %t/definesPoint{-after,}.swift |
| 17 | +// RUN: touch -t 200201010101 %t/* |
| 18 | +// RUN: touch -t 200101010101 %t/*.swift |
| 19 | +// RUN: touch -t 200301010101 %t/definesPoint.swift |
| 20 | + |
| 21 | +// RUN: cd %t && %swiftc_driver -enable-batch-mode -j2 -incremental -driver-show-incremental main.swift definesPoint.swift usesPoint.swift usesDisplay.swift -module-name main -output-file-map ofm.json >&output2 |
| 22 | + |
| 23 | +// RUN: %FileCheck -check-prefix=CHECK-STATUS-QUO-RECOMPILED %s < %t/output2 |
| 24 | + |
| 25 | +// CHECK-STATUS-QUO-RECOMPILED: Queuing because of dependencies discovered later: {compile: usesPoint.o <= usesPoint.swift} |
| 26 | +// CHECK-STATUS-QUO-RECOMPILED: Queuing because of dependencies discovered later: {compile: usesDisplay.o <= usesDisplay.swift} |
| 27 | + |
| 28 | + |
| 29 | +// ============================================================================= |
| 30 | +// With private dependencies |
| 31 | +// ============================================================================= |
| 32 | + |
| 33 | +// Establish status quo |
| 34 | + |
| 35 | +// RUN: %empty-directory(%t) |
| 36 | +// RUN: cp %S/Inputs/superfluous-cascade/* %t |
| 37 | +// RUN: cp %t/definesPoint{-before,}.swift |
| 38 | +// RUN: touch -t 200101010101 %t/*.swift |
| 39 | + |
| 40 | +// RUN: cd %t && %swiftc_driver -enable-batch-mode -j2 -incremental -driver-show-incremental main.swift definesPoint.swift usesPoint.swift usesDisplay.swift -module-name main -output-file-map ofm.json -experimental-private-intransitive-dependencies >&output3 |
| 41 | + |
| 42 | +// Change one type - now only the user of that type rebuilds |
| 43 | + |
| 44 | +// RUN: cp %t/definesPoint{-after,}.swift |
| 45 | +// RUN: touch -t 200201010101 %t/* |
| 46 | +// RUN: touch -t 200101010101 %t/*.swift |
| 47 | +// RUN: touch -t 200301010101 %t/definesPoint.swift |
| 48 | + |
| 49 | +// RUN: cd %t && %swiftc_driver -enable-batch-mode -j2 -incremental -driver-show-incremental main.swift definesPoint.swift usesPoint.swift usesDisplay.swift -module-name main -output-file-map ofm.json -experimental-private-intransitive-dependencies >&output4 |
| 50 | + |
| 51 | +// RUN: %FileCheck -check-prefix=CHECK-PRIVATE-RECOMPILED %s --dump-input=always < %t/output4 |
| 52 | + |
| 53 | +// CHECK-PRIVATE-RECOMPILED: Queuing because of dependencies discovered later: {compile: usesPoint.o <= usesPoint.swift} |
| 54 | +// CHECK-PRIVATE-RECOMPILED-NOT: Queuing because of dependencies discovered later: {compile: usesDisplay.o <= usesDisplay.swift} |
| 55 | + |
| 56 | + |
0 commit comments