Skip to content

Commit adc73a8

Browse files
committed
Update new Span-related tests to enable Span experimental feature
1 parent 531a1ab commit adc73a8

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

test/Macros/PointerBounds/CountedBy/MutableSpan.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// REQUIRES: swift_swift_parser
22
// REQUIRES: pointer_bounds
3-
// XFAIL: OS=windows-msvc
4-
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions 2>&1 | %FileCheck --match-full-lines %s
3+
// REQUIRES: swift_feature_Span
4+
5+
// RUN: not %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions -enable-experimental-feature Span > %t.log 2>&1
6+
// RUN: %FileCheck --match-full-lines %s < %t.log
57

68
@PointerBounds(.countedBy(pointer: 1, count: "len"), .nonescaping(pointer: 1))
79
func myFunc(_ ptr: UnsafeMutablePointer<CInt>, _ len: CInt) {

test/Macros/PointerBounds/CountedBy/SimpleSpan.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// REQUIRES: swift_swift_parser
22
// REQUIRES: pointer_bounds
3+
// REQUIRES: swift_feature_Span
34

4-
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions 2>&1 | %FileCheck --match-full-lines %s
5+
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions -enable-experimental-feature Span 2>&1 | %FileCheck --match-full-lines %s
56

67
@PointerBounds(.countedBy(pointer: 1, count: "len"), .nonescaping(pointer: 1))
78
func myFunc(_ ptr: UnsafePointer<CInt>, _ len: CInt) {

test/Macros/PointerBounds/CountedBy/SimpleSpanWithReturn.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// REQUIRES: swift_swift_parser
22
// REQUIRES: pointer_bounds
3+
// REQUIRES: swift_feature_Span
34

4-
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions 2>&1 | %FileCheck --match-full-lines %s
5+
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions -enable-experimental-feature Span 2>&1 | %FileCheck --match-full-lines %s
56

67
@PointerBounds(.countedBy(pointer: 1, count: "len"), .nonescaping(pointer: 1))
78
func myFunc(_ ptr: UnsafePointer<CInt>, _ len: CInt) -> CInt {

test/Macros/PointerBounds/SizedBy/MutableRawSpan.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// REQUIRES: swift_swift_parser
22
// REQUIRES: pointer_bounds
3-
// XFAIL: OS=windows-msvc
4-
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions 2>&1 | %FileCheck --match-full-lines %s
3+
// REQUIRES: swift_feature_Span
4+
5+
// RUN: not %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions -enable-experimental-feature Span > %t.log 2>&1
6+
// RUN: %FileCheck --match-full-lines %s < %t.log
57

68
@PointerBounds(.sizedBy(pointer: 1, size: "size"), .nonescaping(pointer: 1))
79
func myFunc(_ ptr: UnsafeMutableRawPointer, _ size: CInt) {

test/Macros/PointerBounds/SizedBy/SimpleRawSpan.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// REQUIRES: swift_swift_parser
22
// REQUIRES: pointer_bounds
3+
// REQUIRES: swift_feature_Span
34

4-
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions 2>&1 | %FileCheck --match-full-lines %s
5+
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions -enable-experimental-feature Span 2>&1 | %FileCheck --match-full-lines %s
56

67
@PointerBounds(.sizedBy(pointer: 1, size: "size"), .nonescaping(pointer: 1))
78
func myFunc(_ ptr: UnsafeRawPointer, _ size: CInt) {

test/Macros/PointerBounds/SizedBy/SimpleRawSpanWithReturn.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// REQUIRES: swift_swift_parser
22
// REQUIRES: pointer_bounds
3+
// REQUIRES: swift_feature_Span
34

4-
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions 2>&1 | %FileCheck --match-full-lines %s
5+
// RUN: %target-swift-frontend %s -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions -enable-experimental-feature Span 2>&1 | %FileCheck --match-full-lines %s
56

67
@PointerBounds(.sizedBy(pointer: 1, size: "size"), .nonescaping(pointer: 1))
78
func myFunc(_ ptr: UnsafeRawPointer, _ size: CInt) -> CInt {

0 commit comments

Comments
 (0)