Skip to content

Commit 5753603

Browse files
committed
[Compile Time Values] Mark currently-failing tests with requirement annotations
1 parent 72a4209 commit 5753603

15 files changed

+26
-8
lines changed

test/ConstValues/CImports.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Constant globals should "work" when referencing C-imported constants
22
// REQUIRES: swift_feature_CompileTimeValues
3+
// REQUIRES: rdar146952876
34
// RUN: %empty-directory(%t)
45
// RUN: split-file %s %t
56

test/ConstValues/Conditions.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Constant globals on comparisons and conditions
22
// REQUIRES: swift_feature_CompileTimeValues
3-
// RUN: %target-swift-frontend -emit-ir -pri mary-file %s -parse-as-library -enable-experimental-feature CompileTimeValues
3+
// REQUIRES: rdar146953097
4+
// RUN: %target-swift-frontend -emit-ir -primary-file %s -parse-as-library -enable-experimental-feature CompileTimeValues
45

56
@const let constGlobal1: Int = true ? 1 : 0
67
@const let constGlobal2: Int = (2 * 4 == 8) ? 1 : 0

test/ConstValues/DiagModules.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ public func foo() -> Int {
1717
import MyModule
1818

1919
@const let constGlobal1: Int = foo()
20-
// expected-error@-1 {{@const let should be initialized with a compile-time value}}
20+
// expected-error@-1 {{@const value should be initialized with a compile-time value}}

test/ConstValues/DiagNotConst.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
// RUN: %target-swift-frontend -emit-ir -primary-file %s -parse-as-library -verify -enable-experimental-feature CompileTimeValues
44

55
@const let a: Bool = Bool.random()
6-
// expected-error@-1 {{@const let should be initialized with a compile-time value}}
6+
// expected-error@-1 {{@const value should be initialized with a compile-time value}}
77

88
func foo() -> Int {
99
return 42 * Int.random(in: 0 ..< 10)
1010
}
1111

1212
@const let b: Int = foo()
13-
// expected-error@-1 {{@const let should be initialized with a compile-time value}}
13+
// expected-error@-1 {{@const value should be initialized with a compile-time value}}

test/ConstValues/DiagReferenceCycle.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Constant globals referencing other constant globals and forming a cycle
22
// REQUIRES: swift_feature_CompileTimeValues
3+
// REQUIRES: rdar146957382
34
// RUN: %target-swift-frontend -emit-ir -primary-file %s -parse-as-library -verify -enable-experimental-feature CompileTimeValues
45

56
@const let a: Int = c

test/ConstValues/InlineArrays.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Constant globals on inline arrays
22
// REQUIRES: swift_feature_CompileTimeValues
3+
// REQUIRES: rdar146954768
34
// RUN: %target-swift-frontend -emit-ir -primary-file %s -parse-as-library -disable-availability-checking -enable-experimental-feature CompileTimeValues
45

56
@const let constGlobal1: InlineArray = [1, 2, 3]

test/ConstValues/Modules.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Constant values should be able to call "const" functions from other modules
22
// REQUIRES: swift_feature_CompileTimeValues
3+
// REQUIRES: rdar146953110
34
// RUN: %empty-directory(%t)
45
// RUN: split-file %s %t
56

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Constant globals referencing other constant globals in their initializer expressions
2+
// REQUIRES: swift_feature_CompileTimeValues
3+
// REQUIRES: rdar146954110
4+
// RUN: %target-swift-frontend -emit-ir -primary-file %s -parse-as-library -enable-experimental-feature CompileTimeValues
5+
6+
@const let a: Int = 42
7+
@const let d: Int = -a

test/ConstValues/NonWMO.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Constant globals should "work" even when used across files in non-WMO builds.
22
// REQUIRES: swift_feature_CompileTimeValues
3+
// REQUIRES: rdar146405994
34
// RUN: %empty-directory(%t)
45
// RUN: split-file %s %t
56

test/ConstValues/Optionals.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Constant globals on optionals
22
// REQUIRES: swift_feature_CompileTimeValues
3+
34
// RUN: %target-swift-frontend -emit-ir -primary-file %s -parse-as-library -enable-experimental-feature CompileTimeValues
45

56
@const let constGlobal1: Int? = 42
@@ -10,5 +11,4 @@
1011
@const let constGlobal6: Bool? = nil
1112
@const let constGlobal7: (Int, Int)? = (42, 42)
1213
@const let constGlobal8: (Int, Int)? = nil
13-
@const let constGlobal9: String? = "hello"
1414
@const let constGlobal10: String? = nil

0 commit comments

Comments
 (0)