diff options
| author | Sam Clegg <sbc@chromium.org> | 2017-11-30 22:34:58 +0000 |
|---|---|---|
| committer | Sam Clegg <sbc@chromium.org> | 2017-11-30 22:34:58 +0000 |
| commit | 9138b7b0059521d6dabbc26362e00eaa69a6aec8 (patch) | |
| tree | 70e2f8184231bfa0d4d3666b382f6307355c5c0e /llvm/test/MC/WebAssembly/visibility.ll | |
| parent | f71964a1847427d1f89562de81a05b4a01939905 (diff) | |
| download | bcm5719-llvm-9138b7b0059521d6dabbc26362e00eaa69a6aec8.tar.gz bcm5719-llvm-9138b7b0059521d6dabbc26362e00eaa69a6aec8.zip | |
Add visibility flag to Wasm symbol flags
The LLVM "hidden" flag needs to be passed through the Wasm
intermediate objects in order for the linker to apply
it to the final Wasm object.
The corresponding change in LLD is here: https://github.com/WebAssembly/lld/pull/14
Patch by Nicholas Wilson
Differential Revision: https://reviews.llvm.org/D40442
llvm-svn: 319488
Diffstat (limited to 'llvm/test/MC/WebAssembly/visibility.ll')
| -rw-r--r-- | llvm/test/MC/WebAssembly/visibility.ll | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/MC/WebAssembly/visibility.ll b/llvm/test/MC/WebAssembly/visibility.ll new file mode 100644 index 00000000000..b445bf45e29 --- /dev/null +++ b/llvm/test/MC/WebAssembly/visibility.ll @@ -0,0 +1,23 @@ +; RUN: llc -mtriple wasm32-unknown-unknown-wasm -filetype=obj %s -o - | obj2yaml | FileCheck %s + +; Function with __attribute__((visibility("default"))) +define void @defaultVis() #0 { +entry: + ret void +} + +; Function with __attribute__((visibility("hidden"))) +define hidden void @hiddenVis() #0 { +entry: + ret void +} + +; CHECK: - Type: CUSTOM + +; CHECK: - Type: CUSTOM +; CHECK-NEXT: Name: linking +; CHECK-NEXT: DataSize: 0 +; CHECK-NEXT: SymbolInfo: +; CHECK-NEXT: - Name: hiddenVis +; CHECK-NEXT: Flags: 4 +; CHECK-NEXT: ... |

