Skip to content

Commit 82d5fbd

Browse files
[NFC] Add minimal test case for rdar://problem/57644243.
1 parent ee18c00 commit 82d5fbd

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

test/Sema/clang_types_in_ast.swift

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// RUN: %target-swift-frontend %s -typecheck -DNOCRASH2 -sdk %clang-importer-sdk
55
// RUN: %target-swift-frontend %s -typecheck -DNOCRASH2 -sdk %clang-importer-sdk -use-clang-function-types
66
// 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
79

810
// FIXME: [clang-function-type-serialization] This should stop crashing once we
911
// start serializing clang function types.
@@ -25,12 +27,38 @@ func f() {
2527
#endif
2628

2729
#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+
}
2948
#endif
3049

3150
#if CRASH
3251
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
3563
}
3664
#endif

0 commit comments

Comments
 (0)