1
1
// RUN: %empty-directory(%t)
2
2
// RUN: cp %s %t/main.swift
3
+
4
+ // Build PlaygroundSupport module
3
5
// 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
10
24
11
25
// REQUIRES: executable_test
12
26
// REQUIRES: concurrency
@@ -28,25 +42,25 @@ async let fac4 = factorial(4)
28
42
print ( await fac4)
29
43
30
44
// return await x * factorial(x - 1)
31
- // CHECK: [22 :{{[[:digit:]]+}}-22 :{{[[:digit:]]+}}] __builtin_log[='1']
45
+ // CHECK: [36 :{{[[:digit:]]+}}-36 :{{[[:digit:]]+}}] __builtin_log[='1']
32
46
33
47
// return await x * factorial(x - 1)
34
- // CHECK: [24 :{{[[:digit:]]+}}-24 :{{[[:digit:]]+}}] __builtin_log[='1']
48
+ // CHECK: [38 :{{[[:digit:]]+}}-38 :{{[[:digit:]]+}}] __builtin_log[='1']
35
49
36
50
// return await x * factorial(x - 1)
37
- // CHECK: [24 :{{[[:digit:]]+}}-24 :{{[[:digit:]]+}}] __builtin_log[='2']
51
+ // CHECK: [38 :{{[[:digit:]]+}}-38 :{{[[:digit:]]+}}] __builtin_log[='2']
38
52
39
53
// return await x * factorial(x - 1)
40
- // CHECK: [24 :{{[[:digit:]]+}}-24 :{{[[:digit:]]+}}] __builtin_log[='6']
54
+ // CHECK: [38 :{{[[:digit:]]+}}-38 :{{[[:digit:]]+}}] __builtin_log[='6']
41
55
42
56
// return await x * factorial(x - 1)
43
- // CHECK: [24 :{{[[:digit:]]+}}-24 :{{[[:digit:]]+}}] __builtin_log[='24']
57
+ // CHECK: [38 :{{[[:digit:]]+}}-38 :{{[[:digit:]]+}}] __builtin_log[='24']
44
58
45
59
// 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
47
61
48
62
// (actually print the thing)
49
63
// CHECK-NEXT: 24
50
64
51
65
// print(await fac4)
52
- // CHECK-NEXT: [28 :{{[[:digit:]]+}}-28 :{{[[:digit:]]+}}] __builtin_postPrint
66
+ // CHECK-NEXT: [42 :{{[[:digit:]]+}}-42 :{{[[:digit:]]+}}] __builtin_postPrint
0 commit comments