Skip to content

Commit bcdebc6

Browse files
authored
Merge pull request #31893 from gottesmm/pr-e30fc84371dfcdf423f57d1078c16c88b8cc2643
[silgen] Add an extra swift-version 5 run to initializer tests.
2 parents 6379387 + d4e09b0 commit bcdebc6

7 files changed

+47
-10
lines changed

test/Interpreter/convenience_init_peer_delegation.swift

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
// RUN: %empty-directory(%t)
2-
2+
//
33
// RUN: %target-build-swift %s -Xfrontend -disable-objc-attr-requires-foundation-module -o %t/main
44
// RUN: %target-codesign %t/main
55
// RUN: %target-run %t/main | %FileCheck %s
66

7+
// RUN: %empty-directory(%t)
8+
//
79
// RUN: sed -e 's/required//g' < %s > %t/without_required.swift
810
// RUN: %target-build-swift %t/without_required.swift -Xfrontend -disable-objc-attr-requires-foundation-module -o %t/without_required
911
// RUN: %target-codesign %t/without_required
1012
// RUN: %target-run %t/without_required | %FileCheck %s
1113

14+
// RUN: %empty-directory(%t)
15+
//
16+
// RUN: %target-build-swift %s -Xfrontend -disable-objc-attr-requires-foundation-module -o %t/main -swift-version 5
17+
// RUN: %target-codesign %t/main
18+
// RUN: %target-run %t/main | %FileCheck %s
19+
20+
// RUN: %empty-directory(%t)
21+
//
22+
// RUN: sed -e 's/required//g' < %s > %t/without_required.swift
23+
// RUN: %target-build-swift %t/without_required.swift -Xfrontend -disable-objc-attr-requires-foundation-module -o %t/without_required -swift-version 5
24+
// RUN: %target-codesign %t/without_required
25+
// RUN: %target-run %t/without_required | %FileCheck %s
26+
1227
// REQUIRES: executable_test
1328
// REQUIRES: objc_interop
1429
// XFAIL: CPU=arm64e

test/Interpreter/failable_initializers.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// RUN: %target-run-simple-swift
1+
// RUN: %target-run-simple-swift(-swift-version 4)
2+
// RUN: %target-run-simple-swift(-swift-version 5)
3+
24
// REQUIRES: executable_test
35

46
import StdlibUnittest

test/Interpreter/initializers.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// RUN: %target-run-simple-swift | %FileCheck %s
1+
// RUN: %target-run-simple-swift(-swift-version 4) | %FileCheck %s
2+
// RUN: %target-run-simple-swift(-swift-version 5) | %FileCheck %s
3+
24
// REQUIRES: executable_test
35

46
// Test initialization and initializer inheritance.

test/Interpreter/objc_failable_initializers.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@
55
// RUN: %target-codesign %t/a.out
66
// RUN: %target-run %t/a.out
77

8+
// RUN: %empty-directory(%t)
9+
//
10+
// target-build-swift assumes we want -swift-version 4. Behavior in initializers
11+
// changed in swift 5, so we want to explicitly check it as well.
12+
//
13+
// RUN: %target-clang -fobjc-arc %S/Inputs/ObjCClasses/ObjCClasses.m -c -o %t/ObjCClasses.o
14+
// RUN: %target-build-swift -I %S/Inputs/ObjCClasses/ -Xlinker %t/ObjCClasses.o %s -o %t/a.out -swift-version 5
15+
// RUN: %target-codesign %t/a.out
16+
// RUN: %target-run %t/a.out
17+
818
// REQUIRES: executable_test
919
// REQUIRES: objc_interop
1020

test/Interpreter/protocol_initializers.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
12
// RUN: %empty-directory(%t)
2-
// RUN: %target-build-swift -swift-version 5 %s -o %t/a.out
3+
//
4+
// RUN: %target-build-swift %s -o %t/a.out
35
// RUN: %target-codesign %t/a.out
6+
// RUN: %target-run %t/a.out
7+
8+
// RUN: %empty-directory(%t)
49
//
10+
// RUN: %target-build-swift -swift-version 5 %s -o %t/a.out
11+
// RUN: %target-codesign %t/a.out
512
// RUN: %target-run %t/a.out
13+
614
// REQUIRES: executable_test
715

816
import StdlibUnittest

test/Interpreter/protocol_initializers_class.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
// RUN: %empty-directory(%t)
2-
// RUN: %target-build-swift -swift-version 5 %s -o %t/a.out
3-
// RUN: %target-codesign %t/a.out
4-
//
5-
// RUN: %target-run %t/a.out
1+
// RUN: %target-run-simple-swift(-swift-version 4)
2+
// RUN: %target-run-simple-swift(-swift-version 5)
3+
64
// REQUIRES: executable_test
75

86
import StdlibUnittest

test/Interpreter/throwing_initializers.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// RUN: %target-run-simple-swift
1+
// RUN: %target-run-simple-swift(-swift-version 4)
2+
// RUN: %target-run-simple-swift(-swift-version 5)
3+
24
// REQUIRES: executable_test
35

46
import StdlibUnittest

0 commit comments

Comments
 (0)