Skip to content

Commit d5ef9a0

Browse files
author
David Ungar
committed
Enhance module-fingerprint.swift to check the exclusion
1 parent a4d32f9 commit d5ef9a0

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
public func fromC(parameter: Int = 0) {}
22

3+
struct S {
4+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
public func fromC(parameter: Int = 0) {}
2+
3+
struct S {
4+
public func member() {}
5+
}
6+
public func other() {}

test/Incremental/CrossModule/module-fingerprint.swift

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
// RUN: %target-swift-ide-test -print-module-metadata -module-to-print B -enable-swiftsourceinfo -I %t -source-filename %s | %FileCheck %s --check-prefix=CHECK-CLEAN-B
1414
// RUN: %target-swift-ide-test -print-module-metadata -module-to-print A -enable-swiftsourceinfo -I %t -source-filename %s | %FileCheck %s --check-prefix=CHECK-CLEAN-A
1515

16-
// CHECK-CLEAN-C: fingerprint=6e60fd224d614a59568a348e0ac9b55a
17-
// CHECK-CLEAN-B: fingerprint=bfa14052e1df9253b7bf7e0eb7cfc505
18-
// CHECK-CLEAN-A: fingerprint=a939d89f07c766a4607c5fe1a1715cf5
16+
// CHECK-CLEAN-C: fingerprint=7957733a8ee9bc44f726a516108786eb
17+
// CHECK-CLEAN-B: fingerprint=17bb71bdc7972a93446d524f47044156
18+
// CHECK-CLEAN-A: fingerprint=048332944f6e149f2e8bed309d47283d
1919

2020
//
2121
// Now change C and ensure that B rebuilds but A does not
@@ -32,6 +32,25 @@
3232
// RUN: %target-swift-ide-test -print-module-metadata -module-to-print B -enable-swiftsourceinfo -I %t -source-filename %s | %FileCheck %s --check-prefix=CHECK-INCREMENTAL-B
3333
// RUN: %target-swift-ide-test -print-module-metadata -module-to-print A -enable-swiftsourceinfo -I %t -source-filename %s | %FileCheck %s --check-prefix=CHECK-INCREMENTAL-A
3434

35-
// CHECK-INCREMENTAL-C: fingerprint=3e68d59b74032e18401ec978cdb11cf3
36-
// CHECK-INCREMENTAL-B: fingerprint=bfa14052e1df9253b7bf7e0eb7cfc505
37-
// CHECK-INCREMENTAL-A: fingerprint=a939d89f07c766a4607c5fe1a1715cf5
35+
// CHECK-INCREMENTAL-C: fingerprint=263f083edcaaf08536f657d10082dacc
36+
// CHECK-INCREMENTAL-B: fingerprint=17bb71bdc7972a93446d524f47044156
37+
// CHECK-INCREMENTAL-A: fingerprint=048332944f6e149f2e8bed309d47283d
38+
39+
//
40+
// Now change a top-level type of C and ensure that C's fingerprint does not change
41+
//
42+
43+
// RUN: cp %S/Inputs/module-fingerprint/C2.swift %t/C.swift
44+
45+
// RUN: cd %t && %target-swiftc_driver -c -incremental -emit-dependencies -emit-module -emit-module-path %t/C.swiftmodule -enable-experimental-cross-module-incremental-build -module-name C -I %t -output-file-map %t/C.json -working-directory %t -driver-show-incremental -driver-show-job-lifecycle C.swift
46+
// RUN: touch %t/C.swiftmodule
47+
// RUN: cd %t && %target-swiftc_driver -c -incremental -emit-dependencies -emit-module -emit-module-path %t/B.swiftmodule -enable-experimental-cross-module-incremental-build -module-name B -I %t -output-file-map %t/B.json -working-directory %t -driver-show-incremental -driver-show-job-lifecycle B.swift
48+
// RUN: cd %t && %target-swiftc_driver -c -incremental -emit-dependencies -emit-module -emit-module-path %t/A.swiftmodule -enable-experimental-cross-module-incremental-build -module-name A -I %t -output-file-map %t/A.json -working-directory %t -driver-show-incremental -driver-show-job-lifecycle A.swift
49+
50+
// RUN: %target-swift-ide-test -print-module-metadata -module-to-print C -enable-swiftsourceinfo -I %t -source-filename %s | %FileCheck %s --check-prefix=CHECK-INCREMENTAL2-C
51+
// RUN: %target-swift-ide-test -print-module-metadata -module-to-print B -enable-swiftsourceinfo -I %t -source-filename %s | %FileCheck %s --check-prefix=CHECK-INCREMENTAL2-B
52+
// RUN: %target-swift-ide-test -print-module-metadata -module-to-print A -enable-swiftsourceinfo -I %t -source-filename %s | %FileCheck %s --check-prefix=CHECK-INCREMENTAL2-A
53+
54+
// CHECK-INCREMENTAL2-C: fingerprint=263f083edcaaf08536f657d10082dacc
55+
// CHECK-INCREMENTAL2-B: fingerprint=17bb71bdc7972a93446d524f47044156
56+
// CHECK-INCREMENTAL2-A: fingerprint=048332944f6e149f2e8bed309d47283d

0 commit comments

Comments
 (0)