Skip to content

Commit 32846ed

Browse files
Merge pull request #84434 from kateinoigakukun/yt/cherry-pick-gh84215-release-6.2
2 parents 5117ae5 + 6690241 commit 32846ed

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

lib/Serialization/ModuleFormat.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
5858
/// describe what change you made. The content of this comment isn't important;
5959
/// it just ensures a conflict if two people change the module format.
6060
/// Don't worry about adhering to the 80-column limit for this line.
61-
const uint16_t SWIFTMODULE_VERSION_MINOR = 947; // @preEnumExtensibility attribute
61+
const uint16_t SWIFTMODULE_VERSION_MINOR = 948; // @_expose kind
6262

6363
/// A standard hash seed used for all string hashes in a serialized module.
6464
///
@@ -2526,7 +2526,7 @@ namespace decls_block {
25262526
>;
25272527

25282528
using ExposeDeclAttrLayout = BCRecordLayout<Expose_DECL_ATTR,
2529-
BCFixed<1>, // exposure kind
2529+
BCFixed<2>, // exposure kind
25302530
BCFixed<1>, // implicit flag
25312531
BCBlob // declaration name
25322532
>;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend -module-name attr_expose -emit-module -parse-as-library -o %t %s
3+
// RUN: %target-sil-opt -enable-sil-verify-all %t/attr_expose.swiftmodule | %FileCheck %s
4+
5+
// @_expose
6+
// -----------------------------------------------------------------------------
7+
8+
// CHECK: @_expose(Cxx)
9+
// CHECK-NEXT: func exposeToCxx()
10+
@_expose(Cxx)
11+
func exposeToCxx() -> Int { return 42 }
12+
13+
// CHECK: @_expose(Cxx, "custom_name")
14+
// CHECK-NEXT: func exposeToCxxWithName()
15+
@_expose(Cxx, "custom_name")
16+
func exposeToCxxWithName() -> Int { return 24 }
17+
18+
// CHECK: @_expose(!Cxx)
19+
// CHECK-NEXT: func dontExposeToCxx()
20+
@_expose(!Cxx)
21+
func dontExposeToCxx() -> Int { return 13 }
22+
23+
// CHECK: @_expose(wasm)
24+
// CHECK-NEXT: func exposeToWasm()
25+
@_expose(wasm)
26+
func exposeToWasm() -> Int { return 99 }
27+
28+
// CHECK: @_expose(wasm, "wasm_custom")
29+
// CHECK-NEXT func exposeToWasmWithName()
30+
@_expose(wasm, "wasm_custom")
31+
func exposeToWasmWithName() -> Int { return 88 }

0 commit comments

Comments
 (0)