Skip to content

Commit de1718e

Browse files
committed
test/abi-checker: add a stdlib ABI stability test when asserts are disabled
1 parent 50362a5 commit de1718e

4 files changed

+24
-23
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Func _collectReferencesInsideObject(_:) is a new API without @available attribute
2+
Func _loadDestroyTLSCounter() is a new API without @available attribute
3+
Protocol _RuntimeFunctionCountersStats is a new API without @available attribute
4+
Struct _GlobalRuntimeFunctionCountersState is a new API without @available attribute
5+
Struct _ObjectRuntimeFunctionCountersState is a new API without @available attribute
6+
Struct _RuntimeFunctionCounters is a new API without @available attribute
7+
Func _measureRuntimeFunctionCountersDiffs(objects:_:) is a new API without @available attribute

test/api-digester/Outputs/stability-stdlib-abi.swift.expected renamed to test/api-digester/Outputs/stability-stdlib-abi.without.asserts.swift.expected

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,14 @@ Constructor __SwiftNativeNSData.init(coder:) is a new API without @available att
99
Constructor __SwiftNativeNSDictionary.init(coder:) is a new API without @available attribute
1010
Constructor __SwiftNativeNSSet.init(coder:) is a new API without @available attribute
1111

12-
// Should be fine, only included in stdlib when assertion is enabled.
13-
Func _collectReferencesInsideObject(_:) is a new API without @available attribute
14-
1512
Func _cos(_:) has been removed
1613
Func _exp(_:) has been removed
1714
Func _exp2(_:) has been removed
1815

19-
// Should be fine, only included in stdlib when assertion is enabled.
20-
Func _loadDestroyTLSCounter() is a new API without @available attribute
21-
2216
Func _log(_:) has been removed
2317
Func _log10(_:) has been removed
2418
Func _log2(_:) has been removed
2519

26-
// Should be fine, only included in stdlib when assertion is enabled.
27-
Func _measureRuntimeFunctionCountersDiffs(objects:_:) is a new API without @available attribute
28-
2920
Func _nearbyint(_:) has been removed
3021
Func _rint(_:) has been removed
3122
Func _sin(_:) has been removed
32-
33-
// Should be fine, only included in stdlib when assertion is enabled.
34-
Protocol _RuntimeFunctionCountersStats is a new API without @available attribute
35-
36-
// Should be fine, only included in stdlib when assertion is enabled.
37-
Struct _GlobalRuntimeFunctionCountersState is a new API without @available attribute
38-
39-
// Should be fine, only included in stdlib when assertion is enabled.
40-
Struct _ObjectRuntimeFunctionCountersState is a new API without @available attribute
41-
42-
// Should be fine, only included in stdlib when assertion is enabled.
43-
Struct _RuntimeFunctionCounters is a new API without @available attribute
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// REQUIRES: OS=macosx
2+
// REQUIRES: swift_stdlib_asserts
3+
// RUN: %empty-directory(%t.tmp)
4+
// mkdir %t.tmp/module-cache && mkdir %t.tmp/dummy.sdk
5+
// RUN: %api-digester -dump-sdk -module Swift -o %t.tmp/current-stdlib.json -module-cache-path %t.tmp/module-cache -sdk %t.tmp/dummy.sdk -abi -avoid-location
6+
// RUN: %api-digester -diagnose-sdk -input-paths %S/Inputs/stdlib-stable-abi.json -input-paths %t.tmp/current-stdlib.json -abi -o %t.tmp/changes.txt -v
7+
// RUN: %clang -E -P -x c %S/Outputs/stability-stdlib-abi.without.asserts.swift.expected -o - > %t.tmp/stability-stdlib-abi.swift.expected
8+
// RUN: %clang -E -P -x c %S/Outputs/stability-stdlib-abi.asserts.additional.swift.expected -o - >> %t.tmp/stability-stdlib-abi.swift.expected
9+
// RUN: %clang -E -P -x c %t.tmp/stability-stdlib-abi.swift.expected -o - | sed '/^\s*$/d' | sort > %t.tmp/stability-stdlib-abi.swift.expected.sorted
10+
// RUN: %clang -E -P -x c %t.tmp/changes.txt -o - | sed '/^\s*$/d' | sort > %t.tmp/changes.txt.tmp
11+
// RUN: diff -u %t.tmp/stability-stdlib-abi.swift.expected.sorted %t.tmp/changes.txt.tmp
12+
13+
// The digester can incorrectly register a generic signature change when
14+
// declarations are shuffled. rdar://problem/46618883
15+
// UNSUPPORTED: swift_evolve

test/api-digester/stability-stdlib-abi.swift renamed to test/api-digester/stability-stdlib-abi-without-asserts.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// REQUIRES: OS=macosx
2-
// REQUIRES: asserts
2+
// REQUIRES: swift_stdlib_no_asserts
33
// RUN: %empty-directory(%t.tmp)
44
// mkdir %t.tmp/module-cache && mkdir %t.tmp/dummy.sdk
55
// RUN: %api-digester -dump-sdk -module Swift -o %t.tmp/current-stdlib.json -module-cache-path %t.tmp/module-cache -sdk %t.tmp/dummy.sdk -abi -avoid-location
66
// RUN: %api-digester -diagnose-sdk -input-paths %S/Inputs/stdlib-stable-abi.json -input-paths %t.tmp/current-stdlib.json -abi -o %t.tmp/changes.txt -v
7-
// RUN: %clang -E -P -x c %S/Outputs/stability-stdlib-abi.swift.expected -o - | sed '/^\s*$/d' | sort > %t.tmp/stability-stdlib-abi.swift.expected
7+
// RUN: %clang -E -P -x c %S/Outputs/stability-stdlib-abi.without.asserts.swift.expected -o - | sed '/^\s*$/d' | sort > %t.tmp/stability-stdlib-abi.swift.expected
88
// RUN: %clang -E -P -x c %t.tmp/changes.txt -o - | sed '/^\s*$/d' | sort > %t.tmp/changes.txt.tmp
99
// RUN: diff -u %t.tmp/stability-stdlib-abi.swift.expected %t.tmp/changes.txt.tmp
1010

0 commit comments

Comments
 (0)