xref: /llvm-project/lld/test/wasm/lto/pic-empty.s (revision 4e844a1498820a98eadca54662165a0ac5287439)
1; Test that LTO objects with no function can still be linked as shared
2; libraries.
3; We had a bug where the mutable-globals feature was not being added
4; so the linker-generated import of `__stack_pointer` (which is currently
5; mandatory for ; shared libraries) was generating a linker error.
6; See https://github.com/llvm/llvm-project/issues/51681.
7
8; RUN: llvm-as %s -o %t.o
9; RUN: wasm-ld --lto-O2 --experimental-pic -shared --no-gc-sections --export=tls_int %t.o -o %t.so
10; RUN: obj2yaml %t.so  | FileCheck %s
11
12target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-f128:64-n32:64-S128-ni:1:10:20"
13target triple = "wasm32-unknown-emscripten"
14
15@tls_int = dso_local thread_local global i32 99
16
17; CHECK:  - Type:            CUSTOM
18; CHECK:    Name:            target_features
19; CHECK:    Features:
20; CHECK:      - Prefix:          USED
21; CHECK:        Name:            mutable-globals
22