forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request swiftlang#286 from swiftwasm/master
[pull] swiftwasm from master
- Loading branch information
Showing
13 changed files
with
144 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
test/Frontend/Fingerprints/Inputs/extension-adds-member/definesAB-after.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
struct A { | ||
} | ||
struct B { | ||
} | ||
extension A { | ||
var x: Int {17} | ||
} | ||
extension B { | ||
} |
8 changes: 8 additions & 0 deletions
8
test/Frontend/Fingerprints/Inputs/extension-adds-member/definesAB-before.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
struct A { | ||
} | ||
struct B { | ||
} | ||
extension A { | ||
} | ||
extension B { | ||
} |
1 change: 1 addition & 0 deletions
1
test/Frontend/Fingerprints/Inputs/extension-adds-member/main.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
22 changes: 22 additions & 0 deletions
22
test/Frontend/Fingerprints/Inputs/extension-adds-member/ofm.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"main.swift": { | ||
"object": "./main.o", | ||
"swift-dependencies": "./main.swiftdeps" | ||
}, | ||
"definesAB.swift": { | ||
"object": "./definesAB.o", | ||
"swift-dependencies": "./definesAB.swiftdeps" | ||
}, | ||
"usesA.swift": { | ||
"object": "./usesA.o", | ||
"swift-dependencies": "./usesA.swiftdeps" | ||
}, | ||
"usesB.swift": { | ||
"object": "./usesB.o", | ||
"swift-dependencies": "./usesB.swiftdeps" | ||
}, | ||
"": { | ||
"swift-dependencies": "./main~buildrecord.swiftdeps" | ||
} | ||
} | ||
|
1 change: 1 addition & 0 deletions
1
test/Frontend/Fingerprints/Inputs/extension-adds-member/usesA.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
let a = A() |
1 change: 1 addition & 0 deletions
1
test/Frontend/Fingerprints/Inputs/extension-adds-member/usesB.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
let b = B() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
|
||
// Test per-type-body fingerprints using simple extensions | ||
// | ||
// If the parser is allowed to use a body fingerprint for an extension | ||
// this test will fail because usesA.swift won't be recompiled for the | ||
// last step. | ||
|
||
|
||
// ============================================================================= | ||
// Without the fingerprints | ||
// ============================================================================= | ||
|
||
// Establish status quo | ||
|
||
|
||
// RUN: %empty-directory(%t) | ||
// RUN: cp %S/Inputs/extension-adds-member/* %t | ||
// RUN: cp %t/definesAB{-before,}.swift | ||
|
||
// Seeing weird failure on CI, so set the mod times | ||
// RUN: touch -t 200101010101 %t/*.swift | ||
|
||
|
||
// RUN: cd %t && %swiftc_driver -disable-type-fingerprints -enable-batch-mode -j2 -incremental -driver-show-incremental main.swift definesAB.swift usesA.swift usesB.swift -module-name main -output-file-map ofm.json >& %t/output1 | ||
|
||
|
||
// Change one type, but uses of all types get recompiled | ||
|
||
// RUN: cp %t/definesAB{-after,}.swift | ||
|
||
// Seeing weird failure on CI, so ensure that definesAB.swift is newer | ||
// RUN: touch -t 200201010101 %t/* | ||
// RUN: touch -t 200101010101 %t/*.swift | ||
// RUN: touch -t 200301010101 %t/definesAB.swift | ||
|
||
// RUN: cd %t && %swiftc_driver -disable-type-fingerprints -enable-batch-mode -j2 -incremental -driver-show-incremental main.swift definesAB.swift usesA.swift usesB.swift -module-name main -output-file-map ofm.json >& %t/output2 | ||
|
||
|
||
// This test checks for the status quo; it would be OK to be more conservative | ||
|
||
// RUN: %FileCheck -check-prefix=CHECK-RECOMPILED-WO %s < %t/output2 | ||
// CHECK-RECOMPILED-WO: {compile: definesAB.o <= definesAB.swift} | ||
// CHECK-RECOMPILED-WO: {compile: usesA.o <= usesA.swift} | ||
// CHECK-RECOMPILED-WO: {compile: usesB.o <= usesB.swift} | ||
|
||
// RUN: %FileCheck -check-prefix=CHECK-NOT-RECOMPILED-WO %s < %t/output2 | ||
// CHECK-NOT-RECOMPILED-WO-NOT: {compile: main.o <= main.swift} | ||
|
||
|
||
// ============================================================================= | ||
// With the fingerprints | ||
// ============================================================================= | ||
|
||
// Establish status quo | ||
|
||
// RUN: %empty-directory(%t) | ||
// RUN: cp %S/Inputs/extension-adds-member/* %t | ||
// RUN: cp %t/definesAB{-before,}.swift | ||
|
||
// Seeing weird failure on CI, so set the mod times | ||
// RUN: touch -t 200101010101 %t/*.swift | ||
|
||
// RUN: cd %t && %swiftc_driver -enable-batch-mode -j2 -incremental -driver-show-incremental main.swift definesAB.swift usesA.swift usesB.swift -module-name main -output-file-map ofm.json >& %t/output3 | ||
|
||
// Change one type, only uses of that type get recompiled | ||
|
||
// RUN: cp %t/definesAB{-after,}.swift | ||
|
||
// Seeing weird failure on CI, so ensure that definesAB.swift is newer | ||
// RUN: touch -t 200201010101 %t/* | ||
// RUN: touch -t 200101010101 %t/*.swift | ||
// RUN: touch -t 200301010101 %t/definesAB.swift | ||
|
||
// RUN: cd %t && %swiftc_driver -enable-batch-mode -j2 -incremental -driver-show-incremental main.swift definesAB.swift usesA.swift usesB.swift -module-name main -output-file-map ofm.json >& %t/output4 | ||
|
||
// RUN: %FileCheck -check-prefix=CHECK-RECOMPILED-W %s < %t/output4 | ||
// RUN: %FileCheck -check-prefix=CHECK-NOT-RECOMPILED-W %s < %t/output4 | ||
|
||
// CHECK-RECOMPILED-W: {compile: definesAB.o <= definesAB.swift} | ||
// CHECK-RECOMPILED-W: {compile: usesA.o <= usesA.swift} | ||
|
||
|
||
// CHECK-NOT-RECOMPILED-W-NOT: {compile: main.o <= main.swift} |