Skip to content

Commit 72b88ce

Browse files
authored
Merge pull request #77378 from swiftlang/eng/chrismiles/playground-transform-test-both-swift-5-and-6
Updated PlaygroundTransform tests to cover both Swift 5 and 6.
2 parents 3914cdd + d287715 commit 72b88ce

39 files changed

+751
-239
lines changed
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// test (module-name) -> 1 (module-id)
2-
internal let __builtin_pg_module_test: Int = 1
1+
// testxx (module-name) -> 1 (module-id)
2+
internal let __builtin_pg_module_test5a: Int = 1
3+
internal let __builtin_pg_module_test5b: Int = 1
4+
internal let __builtin_pg_module_test6a: Int = 1
5+
internal let __builtin_pg_module_test6b: Int = 1
36

4-
// test (module-name) -> 1 (module-id)
5-
internal let __builtin_pg_module_test2: Int = 1
6-
7-
// test (module-name), main (file-name), main_ (file-name-punycode) -> 2 (file-id)
8-
internal let __builtin_pg_module_test_pg_file_main_: Int = 2
9-
10-
// test (module-name), main (file-name), main_ (file-name-punycode) -> 2 (file-id)
11-
internal let __builtin_pg_module_test2_pg_file_main_: Int = 2
7+
// testxx (module-name), main (file-name), main_ (file-name-punycode) -> 2 (file-id)
8+
internal let __builtin_pg_module_test5a_pg_file_main_: Int = 2
9+
internal let __builtin_pg_module_test5b_pg_file_main_: Int = 2
10+
internal let __builtin_pg_module_test6a_pg_file_main_: Int = 2
11+
internal let __builtin_pg_module_test6b_pg_file_main_: Int = 2

test/PlaygroundTransform/array.swift

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
// RUN: %empty-directory(%t)
22
// RUN: cp %s %t/main.swift
3+
4+
// Build PlaygroundSupport module
35
// RUN: %target-build-swift -whole-module-optimization -module-name PlaygroundSupport -emit-module-path %t/PlaygroundSupport.swiftmodule -parse-as-library -c -o %t/PlaygroundSupport.o %S/Inputs/SilentPCMacroRuntime.swift %S/Inputs/PlaygroundsRuntime.swift
4-
// RUN: %target-build-swift -Xfrontend -playground -o %t/main -I=%t %t/PlaygroundSupport.o %t/main.swift
5-
// RUN: %target-codesign %t/main
6-
// RUN: %target-run %t/main | %FileCheck %s
7-
// RUN: %target-build-swift -Xfrontend -pc-macro -Xfrontend -playground -o %t/main2 -I=%t %t/PlaygroundSupport.o %t/main.swift
8-
// RUN: %target-codesign %t/main2
9-
// RUN: %target-run %t/main2 | %FileCheck %s
6+
7+
// -playground
8+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -playground -o %t/main5a -I=%t %t/PlaygroundSupport.o %t/main.swift
9+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -playground -o %t/main6a -I=%t %t/PlaygroundSupport.o %t/main.swift
10+
11+
// -pc-macro -playground
12+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -pc-macro -Xfrontend -playground -o %t/main5b -I=%t %t/PlaygroundSupport.o %t/main.swift
13+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -pc-macro -Xfrontend -playground -o %t/main6b -I=%t %t/PlaygroundSupport.o %t/main.swift
14+
15+
// RUN: %target-codesign %t/main5a
16+
// RUN: %target-codesign %t/main5b
17+
// RUN: %target-codesign %t/main6a
18+
// RUN: %target-codesign %t/main6b
19+
20+
// RUN: %target-run %t/main5a | %FileCheck %s
21+
// RUN: %target-run %t/main5b | %FileCheck %s
22+
// RUN: %target-run %t/main6a | %FileCheck %s
23+
// RUN: %target-run %t/main6b | %FileCheck %s
24+
1025
// REQUIRES: executable_test
1126

1227
import PlaygroundSupport

test/PlaygroundTransform/array_did_set.swift

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
// RUN: %empty-directory(%t)
22
// RUN: cp %s %t/main.swift
3+
4+
// Build PlaygroundSupport module
35
// RUN: %target-build-swift -whole-module-optimization -module-name PlaygroundSupport -emit-module-path %t/PlaygroundSupport.swiftmodule -parse-as-library -c -o %t/PlaygroundSupport.o %S/Inputs/SilentPCMacroRuntime.swift %S/Inputs/PlaygroundsRuntime.swift
4-
// RUN: %target-build-swift -Xfrontend -playground -o %t/main -I=%t %t/PlaygroundSupport.o %t/main.swift
5-
// RUN: %target-codesign %t/main
6-
// RUN: %target-run %t/main | %FileCheck %s
7-
// RUN: %target-build-swift -Xfrontend -pc-macro -Xfrontend -playground -o %t/main2 -I=%t %t/PlaygroundSupport.o %t/main.swift
8-
// RUN: %target-codesign %t/main2
9-
// RUN: %target-run %t/main2 | %FileCheck %s
6+
7+
// -playground
8+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -playground -o %t/main5a -I=%t %t/PlaygroundSupport.o %t/main.swift
9+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -playground -o %t/main6a -I=%t %t/PlaygroundSupport.o %t/main.swift
10+
11+
// -pc-macro -playground
12+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -pc-macro -Xfrontend -playground -o %t/main5b -I=%t %t/PlaygroundSupport.o %t/main.swift
13+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -pc-macro -Xfrontend -playground -o %t/main6b -I=%t %t/PlaygroundSupport.o %t/main.swift
14+
15+
// RUN: %target-codesign %t/main5a
16+
// RUN: %target-codesign %t/main5b
17+
// RUN: %target-codesign %t/main6a
18+
// RUN: %target-codesign %t/main6b
19+
20+
// RUN: %target-run %t/main5a | %FileCheck %s
21+
// RUN: %target-run %t/main5b | %FileCheck %s
22+
// RUN: %target-run %t/main6a | %FileCheck %s
23+
// RUN: %target-run %t/main6b | %FileCheck %s
24+
1025
// REQUIRES: executable_test
1126

1227
import PlaygroundSupport

test/PlaygroundTransform/array_in_struct.swift

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
// RUN: %empty-directory(%t)
22
// RUN: cp %s %t/main.swift
3+
4+
// Build PlaygroundSupport module
35
// RUN: %target-build-swift -whole-module-optimization -module-name PlaygroundSupport -emit-module-path %t/PlaygroundSupport.swiftmodule -parse-as-library -c -o %t/PlaygroundSupport.o %S/Inputs/SilentPCMacroRuntime.swift %S/Inputs/PlaygroundsRuntime.swift
4-
// RUN: %target-build-swift -Xfrontend -playground -o %t/main -I=%t %t/PlaygroundSupport.o %t/main.swift
5-
// RUN: %target-run %t/main | %FileCheck %s
6-
// RUN: %target-build-swift -Xfrontend -pc-macro -Xfrontend -playground -o %t/main2 -I=%t %t/PlaygroundSupport.o %t/main.swift
7-
// RUN: %target-run %t/main | %FileCheck %s
6+
7+
// -playground
8+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -playground -o %t/main5a -I=%t %t/PlaygroundSupport.o %t/main.swift
9+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -playground -o %t/main6a -I=%t %t/PlaygroundSupport.o %t/main.swift
10+
11+
// -pc-macro -playground
12+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -pc-macro -Xfrontend -playground -o %t/main5b -I=%t %t/PlaygroundSupport.o %t/main.swift
13+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -pc-macro -Xfrontend -playground -o %t/main6b -I=%t %t/PlaygroundSupport.o %t/main.swift
14+
15+
// RUN: %target-codesign %t/main5a
16+
// RUN: %target-codesign %t/main5b
17+
// RUN: %target-codesign %t/main6a
18+
// RUN: %target-codesign %t/main6b
19+
20+
// RUN: %target-run %t/main5a | %FileCheck %s
21+
// RUN: %target-run %t/main5b | %FileCheck %s
22+
// RUN: %target-run %t/main6a | %FileCheck %s
23+
// RUN: %target-run %t/main6b | %FileCheck %s
24+
825
// REQUIRES: executable_test
926

1027
// FIXME: We need to instrument mutations of objects that are accessed in

test/PlaygroundTransform/async_let.swift

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
// RUN: %empty-directory(%t)
22
// RUN: cp %s %t/main.swift
3+
4+
// Build PlaygroundSupport module
35
// RUN: %target-build-swift -whole-module-optimization -module-name PlaygroundSupport -emit-module-path %t/PlaygroundSupport.swiftmodule -parse-as-library -c -o %t/PlaygroundSupport.o %S/Inputs/SilentPCMacroRuntime.swift %S/Inputs/PlaygroundsRuntime.swift
4-
// RUN: %target-build-swift -Xfrontend -disable-availability-checking -Xfrontend -playground -o %t/main -I=%t %t/PlaygroundSupport.o %t/main.swift
5-
// RUN: %target-codesign %t/main
6-
// RUN: %target-run %t/main | %FileCheck %s
7-
// RUN: %target-build-swift -Xfrontend -disable-availability-checking -Xfrontend -pc-macro -Xfrontend -playground -o %t/main2 -I=%t %t/PlaygroundSupport.o %t/main.swift
8-
// RUN: %target-codesign %t/main2
9-
// RUN: %target-run %t/main2 | %FileCheck %s
6+
7+
// -playground
8+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -disable-availability-checking -Xfrontend -playground -o %t/main5a -I=%t %t/PlaygroundSupport.o %t/main.swift
9+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -disable-availability-checking -Xfrontend -playground -o %t/main6a -I=%t %t/PlaygroundSupport.o %t/main.swift
10+
11+
// -pc-macro -playground
12+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -disable-availability-checking -Xfrontend -pc-macro -Xfrontend -playground -o %t/main5b -I=%t %t/PlaygroundSupport.o %t/main.swift
13+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -disable-availability-checking -Xfrontend -pc-macro -Xfrontend -playground -o %t/main6b -I=%t %t/PlaygroundSupport.o %t/main.swift
14+
15+
// RUN: %target-codesign %t/main5a
16+
// RUN: %target-codesign %t/main5b
17+
// RUN: %target-codesign %t/main6a
18+
// RUN: %target-codesign %t/main6b
19+
20+
// RUN: %target-run %t/main5a | %FileCheck %s
21+
// RUN: %target-run %t/main5b | %FileCheck %s
22+
// RUN: %target-run %t/main6a | %FileCheck %s
23+
// RUN: %target-run %t/main6b | %FileCheck %s
1024

1125
// REQUIRES: executable_test
1226
// REQUIRES: concurrency
@@ -28,25 +42,25 @@ async let fac4 = factorial(4)
2842
print(await fac4)
2943

3044
// return await x * factorial(x - 1)
31-
// CHECK: [22:{{[[:digit:]]+}}-22:{{[[:digit:]]+}}] __builtin_log[='1']
45+
// CHECK: [36:{{[[:digit:]]+}}-36:{{[[:digit:]]+}}] __builtin_log[='1']
3246

3347
// return await x * factorial(x - 1)
34-
// CHECK: [24:{{[[:digit:]]+}}-24:{{[[:digit:]]+}}] __builtin_log[='1']
48+
// CHECK: [38:{{[[:digit:]]+}}-38:{{[[:digit:]]+}}] __builtin_log[='1']
3549

3650
// return await x * factorial(x - 1)
37-
// CHECK: [24:{{[[:digit:]]+}}-24:{{[[:digit:]]+}}] __builtin_log[='2']
51+
// CHECK: [38:{{[[:digit:]]+}}-38:{{[[:digit:]]+}}] __builtin_log[='2']
3852

3953
// return await x * factorial(x - 1)
40-
// CHECK: [24:{{[[:digit:]]+}}-24:{{[[:digit:]]+}}] __builtin_log[='6']
54+
// CHECK: [38:{{[[:digit:]]+}}-38:{{[[:digit:]]+}}] __builtin_log[='6']
4155

4256
// return await x * factorial(x - 1)
43-
// CHECK: [24:{{[[:digit:]]+}}-24:{{[[:digit:]]+}}] __builtin_log[='24']
57+
// CHECK: [38:{{[[:digit:]]+}}-38:{{[[:digit:]]+}}] __builtin_log[='24']
4458

4559
// func factorial(_ x : Int) { ... }
46-
// CHECK-NEXT: [20:{{[[:digit:]]+}}-25:{{[[:digit:]]+}}] __builtin_log_scope_exit
60+
// CHECK-NEXT: [34:{{[[:digit:]]+}}-39:{{[[:digit:]]+}}] __builtin_log_scope_exit
4761

4862
// (actually print the thing)
4963
// CHECK-NEXT: 24
5064

5165
// print(await fac4)
52-
// CHECK-NEXT: [28:{{[[:digit:]]+}}-28:{{[[:digit:]]+}}] __builtin_postPrint
66+
// CHECK-NEXT: [42:{{[[:digit:]]+}}-42:{{[[:digit:]]+}}] __builtin_postPrint

test/PlaygroundTransform/bare_value.swift

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
// RUN: %empty-directory(%t)
22
// RUN: cp %s %t/main.swift
3+
4+
// Build PlaygroundSupport module
35
// RUN: %target-build-swift -whole-module-optimization -module-name PlaygroundSupport -emit-module-path %t/PlaygroundSupport.swiftmodule -parse-as-library -c -o %t/PlaygroundSupport.o %S/Inputs/SilentPCMacroRuntime.swift %S/Inputs/PlaygroundsRuntime.swift
4-
// RUN: %target-build-swift -Xfrontend -playground -o %t/main -I=%t %t/PlaygroundSupport.o %t/main.swift
5-
// RUN: %target-codesign %t/main
6-
// RUN: %target-run %t/main | %FileCheck %s
7-
// RUN: %target-build-swift -Xfrontend -pc-macro -Xfrontend -playground -o %t/main2 -I=%t %t/PlaygroundSupport.o %t/main.swift
8-
// RUN: %target-codesign %t/main2
9-
// RUN: %target-run %t/main2 | %FileCheck %s
6+
7+
// -playground
8+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -playground -o %t/main5a -I=%t %t/PlaygroundSupport.o %t/main.swift
9+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -playground -o %t/main6a -I=%t %t/PlaygroundSupport.o %t/main.swift
10+
11+
// -pc-macro -playground
12+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -pc-macro -Xfrontend -playground -o %t/main5b -I=%t %t/PlaygroundSupport.o %t/main.swift
13+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -pc-macro -Xfrontend -playground -o %t/main6b -I=%t %t/PlaygroundSupport.o %t/main.swift
14+
15+
// RUN: %target-codesign %t/main5a
16+
// RUN: %target-codesign %t/main5b
17+
// RUN: %target-codesign %t/main6a
18+
// RUN: %target-codesign %t/main6b
19+
20+
// RUN: %target-run %t/main5a | %FileCheck %s
21+
// RUN: %target-run %t/main5b | %FileCheck %s
22+
// RUN: %target-run %t/main6a | %FileCheck %s
23+
// RUN: %target-run %t/main6b | %FileCheck %s
24+
1025
// REQUIRES: executable_test
1126

1227
import PlaygroundSupport

test/PlaygroundTransform/closure_parameters.swift

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
// RUN: %empty-directory(%t)
22
// RUN: cp %s %t/main.swift
3+
4+
// Build PlaygroundSupport module
35
// RUN: %target-build-swift -whole-module-optimization -module-name PlaygroundSupport -emit-module-path %t/PlaygroundSupport.swiftmodule -parse-as-library -c -o %t/PlaygroundSupport.o %S/Inputs/SilentPCMacroRuntime.swift %S/Inputs/PlaygroundsRuntime.swift
4-
// RUN: %target-build-swift -Xfrontend -playground -Xfrontend -debugger-support -o %t/main -I=%t %t/PlaygroundSupport.o %t/main.swift
5-
// RUN: %target-codesign %t/main
6-
// RUN: %target-run %t/main | %FileCheck %s
7-
// RUN: %target-build-swift -Xfrontend -pc-macro -Xfrontend -playground -Xfrontend -debugger-support -o %t/main2 -I=%t %t/PlaygroundSupport.o %t/main.swift
8-
// RUN: %target-codesign %t/main2
9-
// RUN: %target-run %t/main2 | %FileCheck %s
6+
7+
// -playground
8+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -playground -Xfrontend -debugger-support -o %t/main5a -I=%t %t/PlaygroundSupport.o %t/main.swift
9+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -playground -Xfrontend -debugger-support -o %t/main6a -I=%t %t/PlaygroundSupport.o %t/main.swift
10+
11+
// -pc-macro -playground
12+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -pc-macro -Xfrontend -playground -Xfrontend -debugger-support -o %t/main5b -I=%t %t/PlaygroundSupport.o %t/main.swift
13+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -pc-macro -Xfrontend -playground -Xfrontend -debugger-support -o %t/main6b -I=%t %t/PlaygroundSupport.o %t/main.swift
14+
15+
// RUN: %target-codesign %t/main5a
16+
// RUN: %target-codesign %t/main5b
17+
// RUN: %target-codesign %t/main6a
18+
// RUN: %target-codesign %t/main6b
19+
20+
// RUN: %target-run %t/main5a | %FileCheck %s
21+
// RUN: %target-run %t/main5b | %FileCheck %s
22+
// RUN: %target-run %t/main6a | %FileCheck %s
23+
// RUN: %target-run %t/main6b | %FileCheck %s
24+
1025
// REQUIRES: executable_test
1126

1227
import PlaygroundSupport

test/PlaygroundTransform/control-flow.swift

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
// RUN: %empty-directory(%t)
22
// RUN: cp %s %t/main.swift
3+
4+
// Build PlaygroundSupport module
35
// RUN: %target-build-swift -whole-module-optimization -module-name PlaygroundSupport -emit-module-path %t/PlaygroundSupport.swiftmodule -parse-as-library -c -o %t/PlaygroundSupport.o %S/Inputs/SilentPCMacroRuntime.swift %S/Inputs/PlaygroundsRuntime.swift
4-
// RUN: %target-build-swift -Xfrontend -playground -o %t/main -I=%t %t/PlaygroundSupport.o %t/main.swift
5-
// RUN: %target-codesign %t/main
6-
// RUN: %target-run %t/main | %FileCheck %s
7-
// RUN: %target-build-swift -Xfrontend -pc-macro -Xfrontend -playground -o %t/main2 -I=%t %t/PlaygroundSupport.o %t/main.swift
8-
// RUN: %target-codesign %t/main2
9-
// RUN: %target-run %t/main2 | %FileCheck %s
6+
7+
// -playground
8+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -playground -o %t/main5a -I=%t %t/PlaygroundSupport.o %t/main.swift
9+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -playground -o %t/main6a -I=%t %t/PlaygroundSupport.o %t/main.swift
10+
11+
// -pc-macro -playground
12+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -pc-macro -Xfrontend -playground -o %t/main5b -I=%t %t/PlaygroundSupport.o %t/main.swift
13+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -pc-macro -Xfrontend -playground -o %t/main6b -I=%t %t/PlaygroundSupport.o %t/main.swift
14+
15+
// RUN: %target-codesign %t/main5a
16+
// RUN: %target-codesign %t/main5b
17+
// RUN: %target-codesign %t/main6a
18+
// RUN: %target-codesign %t/main6b
19+
20+
// RUN: %target-run %t/main5a | %FileCheck %s
21+
// RUN: %target-run %t/main5b | %FileCheck %s
22+
// RUN: %target-run %t/main6a | %FileCheck %s
23+
// RUN: %target-run %t/main6b | %FileCheck %s
24+
1025
// REQUIRES: executable_test
1126

1227
import PlaygroundSupport

test/PlaygroundTransform/declarations.swift

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
// RUN: %empty-directory(%t)
22
// RUN: cp %s %t/main.swift
3+
4+
// Build PlaygroundSupport module
35
// RUN: %target-build-swift -whole-module-optimization -module-name PlaygroundSupport -emit-module-path %t/PlaygroundSupport.swiftmodule -parse-as-library -c -o %t/PlaygroundSupport.o %S/Inputs/SilentPCMacroRuntime.swift %S/Inputs/PlaygroundsRuntime.swift
4-
// RUN: %target-build-swift -Xfrontend -playground -o %t/main -I=%t %t/PlaygroundSupport.o %t/main.swift
5-
// RUN: %target-codesign %t/main
6-
// RUN: %target-run %t/main | %FileCheck %s
7-
// RUN: %target-build-swift -Xfrontend -pc-macro -Xfrontend -playground -o %t/main2 -I=%t %t/PlaygroundSupport.o %t/main.swift
8-
// RUN: %target-codesign %t/main2
9-
// RUN: %target-run %t/main2 | %FileCheck %s
6+
7+
// -playground
8+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -playground -o %t/main5a -I=%t %t/PlaygroundSupport.o %t/main.swift
9+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -playground -o %t/main6a -I=%t %t/PlaygroundSupport.o %t/main.swift
10+
11+
// -pc-macro -playground
12+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -pc-macro -Xfrontend -playground -o %t/main5b -I=%t %t/PlaygroundSupport.o %t/main.swift
13+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -pc-macro -Xfrontend -playground -o %t/main6b -I=%t %t/PlaygroundSupport.o %t/main.swift
14+
15+
// RUN: %target-codesign %t/main5a
16+
// RUN: %target-codesign %t/main5b
17+
// RUN: %target-codesign %t/main6a
18+
// RUN: %target-codesign %t/main6b
19+
20+
// RUN: %target-run %t/main5a | %FileCheck %s
21+
// RUN: %target-run %t/main5b | %FileCheck %s
22+
// RUN: %target-run %t/main6a | %FileCheck %s
23+
// RUN: %target-run %t/main6b | %FileCheck %s
24+
1025
// REQUIRES: executable_test
1126

1227
import PlaygroundSupport

test/PlaygroundTransform/declarations_error.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: cp %s %t/main.swift
3-
// RUN: not %target-swift-frontend -typecheck -playground -diagnostic-style llvm %t/main.swift 2>&1 | %FileCheck %s
3+
// RUN: not %target-swift-frontend -typecheck -swift-version 5 -playground -diagnostic-style llvm %t/main.swift 2>&1 | %FileCheck %s
4+
// RUN: not %target-swift-frontend -typecheck -swift-version 6 -playground -diagnostic-style llvm %t/main.swift 2>&1 | %FileCheck %s
45

56
// CHECK: error: no such module
67
import Nonexistent_Module

test/PlaygroundTransform/defer.swift

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
// RUN: %empty-directory(%t)
22
// RUN: cp %s %t/main.swift
3+
4+
// Build PlaygroundSupport module
35
// RUN: %target-build-swift -whole-module-optimization -module-name PlaygroundSupport -emit-module-path %t/PlaygroundSupport.swiftmodule -parse-as-library -c -o %t/PlaygroundSupport.o %S/Inputs/SilentPCMacroRuntime.swift %S/Inputs/PlaygroundsRuntime.swift
4-
// RUN: %target-build-swift -Xfrontend -playground -Xfrontend -debugger-support -o %t/main -I=%t %t/PlaygroundSupport.o %t/main.swift
5-
// RUN: %target-codesign %t/main
6-
// RUN: %target-run %t/main | %FileCheck %s
7-
// RUN: %target-build-swift -Xfrontend -pc-macro -Xfrontend -playground -Xfrontend -debugger-support -o %t/main2 -I=%t %t/PlaygroundSupport.o %t/main.swift
8-
// RUN: %target-codesign %t/main2
9-
// RUN: %target-run %t/main2 | %FileCheck %s
6+
7+
// -playground
8+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -playground -Xfrontend -debugger-support -o %t/main5a -I=%t %t/PlaygroundSupport.o %t/main.swift
9+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -playground -Xfrontend -debugger-support -o %t/main6a -I=%t %t/PlaygroundSupport.o %t/main.swift
10+
11+
// -pc-macro -playground
12+
// RUN: %target-build-swift -swift-version 5 -Xfrontend -pc-macro -Xfrontend -playground -Xfrontend -debugger-support -o %t/main5b -I=%t %t/PlaygroundSupport.o %t/main.swift
13+
// RUN: %target-build-swift -swift-version 6 -Xfrontend -pc-macro -Xfrontend -playground -Xfrontend -debugger-support -o %t/main6b -I=%t %t/PlaygroundSupport.o %t/main.swift
14+
15+
// RUN: %target-codesign %t/main5a
16+
// RUN: %target-codesign %t/main5b
17+
// RUN: %target-codesign %t/main6a
18+
// RUN: %target-codesign %t/main6b
19+
20+
// RUN: %target-run %t/main5a | %FileCheck %s
21+
// RUN: %target-run %t/main5b | %FileCheck %s
22+
// RUN: %target-run %t/main6a | %FileCheck %s
23+
// RUN: %target-run %t/main6b | %FileCheck %s
24+
1025
// REQUIRES: executable_test
1126

1227
import PlaygroundSupport

0 commit comments

Comments
 (0)