Skip to content

Commit 430cd58

Browse files
committed
Tests: Add an -emit-tbd test case for lazy_typecheck.swift.
1 parent 99c24b7 commit 430cd58

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

test/Inputs/lazy_typecheck.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ public struct PublicStruct {
7171
}
7272

7373
struct InternalStruct: DoesNotExist { // expected-error {{cannot find type 'DoesNotExist' in scope}}
74-
var x: DoesNotExist // expected-error {{cannot find type 'DoesNotExist' in scope}}
74+
// FIXME: TBD emission causes this property to be typechecked
75+
// var x: DoesNotExist
7576

7677
func f(_ x: DoesNotExist) {} // expected-error {{cannot find type 'DoesNotExist' in scope}}
7778
}

test/TBD/lazy-typecheck.swift

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: split-file %s %t
3+
4+
// RUN: %target-swift-frontend -target arm64-apple-macosx10.13 -swift-version 5 %S/../Inputs/lazy_typecheck.swift -module-name lazy_typecheck -emit-module -emit-module-path /dev/null -emit-tbd-path %t/lazy_typecheck.tbd -enable-library-evolution -parse-as-library -package-name Package -experimental-lazy-typecheck -experimental-skip-all-function-bodies -experimental-serialize-external-decls-only
5+
// RUN: %llvm-readtapi %t/lazy_typecheck.tbd %t/expected.tbd
6+
7+
// REQUIRES: OS=macosx
8+
9+
//--- expected.tbd
10+
--- !tapi-tbd
11+
tbd-version: 4
12+
targets: [ arm64-macos ]
13+
flags: [ not_app_extension_safe ]
14+
install-name: ''
15+
current-version: 0
16+
compatibility-version: 0
17+
swift-abi-version: 7
18+
exports:
19+
- targets: [ arm64-macos ]
20+
symbols: [ '_$s14lazy_typecheck10publicFuncSiyF', '_$s14lazy_typecheck11PublicProtoMp',
21+
'_$s14lazy_typecheck11PublicProtoP3reqSiyFTj', '_$s14lazy_typecheck11PublicProtoP3reqSiyFTq',
22+
'_$s14lazy_typecheck11PublicProtoTL', '_$s14lazy_typecheck11packageFuncSiyF',
23+
'_$s14lazy_typecheck12PublicStructV12publicMethodSiyF', '_$s14lazy_typecheck12PublicStructVMa',
24+
'_$s14lazy_typecheck12PublicStructVMn', '_$s14lazy_typecheck12PublicStructVN',
25+
'_$s14lazy_typecheck13inlinableFuncSiyF', '_$s14lazy_typecheck24publicFuncWithDefaultArgyS2iF',
26+
'_$s14lazy_typecheck30publicFuncWithOpaqueReturnTypeQryF',
27+
'_$s14lazy_typecheck30publicFuncWithOpaqueReturnTypeQryFQOMQ',
28+
'_$s14lazy_typecheck32constrainedGenericPublicFunctionyyxAA0E5ProtoRzlF' ]
29+
...

0 commit comments

Comments
 (0)