File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
58
58
// / describe what change you made. The content of this comment isn't important;
59
59
// / it just ensures a conflict if two people change the module format.
60
60
// / 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
62
62
63
63
// / A standard hash seed used for all string hashes in a serialized module.
64
64
// /
@@ -2526,7 +2526,7 @@ namespace decls_block {
2526
2526
>;
2527
2527
2528
2528
using ExposeDeclAttrLayout = BCRecordLayout<Expose_DECL_ATTR,
2529
- BCFixed<1 >, // exposure kind
2529
+ BCFixed<2 >, // exposure kind
2530
2530
BCFixed<1 >, // implicit flag
2531
2531
BCBlob // declaration name
2532
2532
>;
Original file line number Diff line number Diff line change
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 }
You can’t perform that action at this time.
0 commit comments