diff options
Diffstat (limited to 'lld/test/wasm/Inputs/comdat2.ll')
| -rw-r--r-- | lld/test/wasm/Inputs/comdat2.ll | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lld/test/wasm/Inputs/comdat2.ll b/lld/test/wasm/Inputs/comdat2.ll index d910e1afcdf..0618d55aa2f 100644 --- a/lld/test/wasm/Inputs/comdat2.ll +++ b/lld/test/wasm/Inputs/comdat2.ll @@ -1,13 +1,22 @@ target triple = "wasm32-unknown-unknown" -$inlineFn = comdat any -@constantData = weak_odr constant [3 x i8] c"abc", comdat($inlineFn) -define linkonce_odr i32 @inlineFn() comdat { -entry: +$foo = comdat any + +@constantData = constant [3 x i8] c"abc", comdat($foo) + +define i32 @comdatFn() comdat($foo) { ret i32 ptrtoint ([3 x i8]* @constantData to i32) } -define i32 @callInline2() { -entry: - ret i32 ptrtoint (i32 ()* @inlineFn to i32) +define internal void @do_init() comdat($foo) { + ret void +} + +@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void +()*, i8* } { i32 65535, void ()* @do_init, i8* null }] + +; Everything above this is part of the `foo` comdat group + +define i32 @callComdatFn2() { + ret i32 ptrtoint (i32 ()* @comdatFn to i32) } |

