4
4
// RUN: %target-swift-frontend %s -typecheck -DNOCRASH2 -sdk %clang-importer-sdk
5
5
// RUN: %target-swift-frontend %s -typecheck -DNOCRASH2 -sdk %clang-importer-sdk -use-clang-function-types
6
6
// RUN: %target-swift-frontend %s -DAUXMODULE -module-name Foo -emit-module -o %t
7
+ // FIXME: rdar://problem/57644243 : We shouldn't crash if -use-clang-function-types is not enabled.
8
+ // RUN: not --crash %target-swift-frontend %s -typecheck -DNOCRASH3 -I %t
7
9
8
10
// FIXME: [clang-function-type-serialization] This should stop crashing once we
9
11
// start serializing clang function types.
@@ -25,12 +27,38 @@ func f() {
25
27
#endif
26
28
27
29
#if AUXMODULE
28
- public var DUMMY_SIGNAL : Optional < @convention ( c) ( Int32 ) -> Void > = . none
30
+ public var DUMMY_SIGNAL1 : Optional < @convention ( c) ( Int32 ) -> ( ) > = . none
31
+ public var DUMMY_SIGNAL2 : Optional < @convention ( c) ( Int32 ) -> Void > = . none
32
+ #endif
33
+
34
+ #if NOCRASH3
35
+ import Foo
36
+ public func my_signal1( ) -> Optional < @convention ( c) ( Int32 ) -> ( ) > {
37
+ return Foo . DUMMY_SIGNAL1
38
+ }
39
+ public func my_signal2( ) -> Optional < @convention ( c) ( Int32 ) -> Void > {
40
+ return Foo . DUMMY_SIGNAL1
41
+ }
42
+ public func my_signal3( ) -> Optional < @convention ( c) ( Int32 ) -> ( ) > {
43
+ return Foo . DUMMY_SIGNAL2
44
+ }
45
+ public func my_signal4( ) -> Optional < @convention ( c) ( Int32 ) -> Void > {
46
+ return Foo . DUMMY_SIGNAL2
47
+ }
29
48
#endif
30
49
31
50
#if CRASH
32
51
import Foo
33
- public func my_signal( ) -> Optional < @convention ( c) ( Int32 ) -> Void > {
34
- return Foo . DUMMY_SIGNAL
52
+ public func my_signal1( ) -> Optional < @convention ( c) ( Int32 ) -> ( ) > {
53
+ return Foo . DUMMY_SIGNAL1
54
+ }
55
+ public func my_signal2( ) -> Optional < @convention ( c) ( Int32 ) -> Void > {
56
+ return Foo . DUMMY_SIGNAL1
57
+ }
58
+ public func my_signal3( ) -> Optional < @convention ( c) ( Int32 ) -> ( ) > {
59
+ return Foo . DUMMY_SIGNAL2
60
+ }
61
+ public func my_signal4( ) -> Optional < @convention ( c) ( Int32 ) -> Void > {
62
+ return Foo . DUMMY_SIGNAL2
35
63
}
36
64
#endif
0 commit comments