xref: /llvm-project/lld/test/wasm/Inputs/comdat1.ll (revision f01fdd17b4d202727023da23bdd120eb0bd94f9f)
1target triple = "wasm32-unknown-unknown"
2
3$foo = comdat any
4
5@constantData = constant [3 x i8] c"abc", comdat($foo)
6
7define i32 @comdatFn() comdat($foo) {
8  ret i32 ptrtoint (ptr @constantData to i32)
9}
10
11define internal void @do_init() comdat($foo) {
12  ret void
13}
14
15%0 = type { i32, ptr, ptr }
16@llvm.global_ctors = appending global [1 x %0 ] [%0 { i32 65535, ptr @do_init, ptr null }]
17
18; Everything above this is part of the `foo` comdat group
19
20define i32 @callComdatFn1() {
21    ret i32 ptrtoint (ptr @comdatFn to i32)
22}
23