summaryrefslogtreecommitdiffstats
path: root/llvm/test/MC/WebAssembly/weak.s
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/MC/WebAssembly/weak.s')
-rw-r--r--llvm/test/MC/WebAssembly/weak.s24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/MC/WebAssembly/weak.s b/llvm/test/MC/WebAssembly/weak.s
new file mode 100644
index 00000000000..9d13e84e152
--- /dev/null
+++ b/llvm/test/MC/WebAssembly/weak.s
@@ -0,0 +1,24 @@
+# RUN: llvm-mc -triple=wasm32-unknown-unknown -filetype=obj -o %t.o < %s
+# RUN: obj2yaml %t.o | FileCheck %s
+
+weak_function:
+ .functype weak_function () -> (i32)
+ .hidden weak_function
+ .weak weak_function
+ i32.const 0
+ i32.load weak_external_data
+ end_function
+
+.weak weak_external_data
+
+# CHECK: SymbolTable:
+# CHECK-NEXT: - Index: 0
+# CHECK-NEXT: Kind: FUNCTION
+# CHECK-NEXT: Name: weak_function
+# CHECK-NEXT: Flags: [ BINDING_WEAK, VISIBILITY_HIDDEN ]
+# CHECK-NEXT: Function: 0
+# CHECK-NEXT: - Index: 1
+# CHECK-NEXT: Kind: DATA
+# CHECK-NEXT: Name: weak_external_data
+# CHECK-NEXT: Flags: [ BINDING_WEAK, UNDEFINED ]
+# CHECK-NEXT: ...
OpenPOWER on IntegriCloud