summaryrefslogtreecommitdiffstats
path: root/lld/test/wasm/export-all.ll
diff options
context:
space:
mode:
Diffstat (limited to 'lld/test/wasm/export-all.ll')
-rw-r--r--lld/test/wasm/export-all.ll45
1 files changed, 45 insertions, 0 deletions
diff --git a/lld/test/wasm/export-all.ll b/lld/test/wasm/export-all.ll
new file mode 100644
index 00000000000..450c6e38e84
--- /dev/null
+++ b/lld/test/wasm/export-all.ll
@@ -0,0 +1,45 @@
+; RUN: llc -O0 -filetype=obj %s -o %t.o
+
+; RUN: wasm-ld -o %t.wasm %t.o
+; RUN: obj2yaml %t.wasm | FileCheck %s
+
+; RUN: wasm-ld --export-all -o %t.wasm %t.o
+; RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=EXPORT
+
+; RUN: wasm-ld --export-all --no-gc-sections -o %t.wasm %t.o
+; RUN: obj2yaml %t.wasm | FileCheck %s -check-prefix=NOGC
+
+; Verify the --export-all flag exports hidden symbols
+
+target triple = "wasm32-unknown-unknown"
+
+define hidden void @bar() local_unnamed_addr {
+entry:
+ ret void
+}
+
+define hidden void @foo() local_unnamed_addr {
+entry:
+ ret void
+}
+
+define hidden void @_start() local_unnamed_addr {
+entry:
+ call void @foo()
+ ret void
+}
+
+; CHECK: - Type: EXPORT
+; CHECK: - Name: _start
+; CHECK-NOT: - Name: bar
+; CHECK-NOT: - Name: foo
+
+; EXPORT: - Type: EXPORT
+; EXPORT: - Name: _start
+; EXPORT-NOT: - Name: bar
+; EXPORT: - Name: foo
+
+; NOGC: - Type: EXPORT
+; NOGC: - Name: _start
+; NOGC: - Name: bar
+; NOGC: - Name: foo
OpenPOWER on IntegriCloud