File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+
3
+ // RUN: %target-swift-frontend -enable-experimental-feature Embedded -enable-experimental-feature SymbolLinkageMarkers -module-name main -mergeable-symbols -O %s -emit-ir | %FileCheck %s --check-prefix=CHECK-IR
4
+ // RUN: %target-swift-frontend -enable-experimental-feature Embedded -enable-experimental-feature SymbolLinkageMarkers -module-name main -mergeable-symbols -O %s -c -o %t/a.o
5
+ // RUN: %target-clang %t/a.o -o %t/a.out -dead_strip
6
+ // RUN: %llvm-nm --defined-only --format=just-symbols --demangle %t/a.out | sort | %FileCheck %s --check-prefix=CHECK-NM
7
+ // RUN: %target-run %t/a.out | %FileCheck %s
8
+
9
+ // REQUIRES: swift_in_compiler
10
+ // REQUIRES: executable_test
11
+ // REQUIRES: OS=macosx
12
+ // REQUIRES: swift_feature_Embedded
13
+
14
+ public func a_this_is_unused( ) { }
15
+
16
+ @_used
17
+ public func b_this_is_unused_but_explicitly_retained( ) { }
18
+
19
+ // CHECK-IR: define weak_odr {{.*}}@"$e4main16a_this_is_unusedyyF"()
20
+ // CHECK-IR: define weak_odr {{.*}}@"$e4main40b_this_is_unused_but_explicitly_retainedyyF"()
21
+
22
+ // CHECK-NM-NOT: $e4main14this_is_unusedyyF
23
+ // CHECK-NM: $e4main40b_this_is_unused_but_explicitly_retainedyyF
24
+
25
+ print ( " Hello " )
26
+ // CHECK: Hello
You can’t perform that action at this time.
0 commit comments