Skip to content

Commit f4efec8

Browse files
committed
[Test] Reproducer for witness table deserialization failure with a enum_flag
1 parent c2f5797 commit f4efec8

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
enum __attribute__((flag_enum,enum_extensibility(open))) CEnum : int {
2+
A = 1 << 0,
3+
B = 1 << 1,
4+
};

test/Serialization/Recovery/Inputs/custom-modules/module.modulemap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ module SuperclassObjC { header "SuperclassObjC.h" }
1313
module Typedefs { header "Typedefs.h" }
1414
module TypeRemovalObjC { header "TypeRemovalObjC.h" }
1515
module Types { header "Types.h" }
16+
module Conformance { header "Conformance.h" }
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/// Recover from reading witness table involving a synthesized conformance
2+
/// rdar://problem/58924131
3+
4+
// RUN: %empty-directory(%t)
5+
// RUN: cp -r %S/Inputs/custom-modules %t/
6+
// RUN: %target-swift-frontend -emit-module %s -module-name MyModule -emit-module-path %t/MyModule.swiftmodule -I %t/custom-modules -swift-version 5
7+
8+
/// Delete the clang module
9+
// RUN: rm -r %t/custom-modules/
10+
11+
// RUN: not %target-sil-opt %t/MyModule.swiftmodule 2>&1 | %FileCheck %s
12+
13+
@_implementationOnly import Conformance
14+
// CHECK: missing required module 'Conformance'
15+
16+
public func foo<T: OptionSet>(_ t: T) {}
17+
18+
foo(CEnum.A)

0 commit comments

Comments
 (0)