Index: test/wasm/Inputs/weak-alias.ll =================================================================== --- test/wasm/Inputs/weak-alias.ll +++ test/wasm/Inputs/weak-alias.ll @@ -20,15 +20,11 @@ define i32 @call_alias_ptr() #0 { entry: -; TODO(sbc): This code currently causes linker failures: -; LLVM ERROR: symbol not found table index space: alias_fn -; See: https://github.com/WebAssembly/tool-conventions/issues/34# -; %fnptr = alloca i32 ()*, align 8 -; store i32 ()* @alias_fn, i32 ()** %fnptr, align 8 -; %0 = load i32 ()*, i32 ()** %fnptr, align 8 -; %call = call i32 %0() -; ret i32 %call - ret i32 1 + %fnptr = alloca i32 ()*, align 8 + store i32 ()* @alias_fn, i32 ()** %fnptr, align 8 + %0 = load i32 ()*, i32 ()** %fnptr, align 8 + %call = call i32 %0() + ret i32 %call } define i32 @call_direct_ptr() #0 { Index: test/wasm/weak-alias-overide.ll =================================================================== --- test/wasm/weak-alias-overide.ll +++ test/wasm/weak-alias-overide.ll @@ -36,8 +36,8 @@ ; CHECK-NEXT: - ElemType: ANYFUNC ; CHECK-NEXT: Limits: ; CHECK-NEXT: Flags: [ HAS_MAX ] -; CHECK-NEXT: Initial: 0x00000002 -; CHECK-NEXT: Maximum: 0x00000002 +; CHECK-NEXT: Initial: 0x00000003 +; CHECK-NEXT: Maximum: 0x00000003 ; CHECK-NEXT: - Type: MEMORY ; CHECK-NEXT: Memories: ; CHECK-NEXT: - Initial: 0x00000002 @@ -79,7 +79,7 @@ ; CHECK-NEXT: - Offset: ; CHECK-NEXT: Opcode: I32_CONST ; CHECK-NEXT: Value: 1 -; CHECK-NEXT: Functions: [ 2 ] +; CHECK-NEXT: Functions: [ 0, 2 ] ; CHECK-NEXT: - Type: CODE ; CHECK-NEXT: Functions: ; CHECK-NEXT: - Locals: @@ -93,11 +93,13 @@ ; CHECK-NEXT: - Locals: ; CHECK-NEXT: Body: 1080808080000B ; CHECK-NEXT: - Locals: -; CHECK-NEXT: Body: 41010B +; CHECK-NEXT: - Type: I32 +; CHECK-NEXT: Count: 2 +; CHECK-NEXT: Body: 23808080800041106B220024808080800020004181808080003602081080808080002101200041106A24808080800020010B ; CHECK-NEXT: - Locals: ; CHECK-NEXT: - Type: I32 ; CHECK-NEXT: Count: 2 -; CHECK-NEXT: Body: 23808080800041106B220024808080800020004181808080003602081082808080002101200041106A24808080800020010B +; CHECK-NEXT: Body: 23808080800041106B220024808080800020004182808080003602081082808080002101200041106A24808080800020010B ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: linking ; CHECK-NEXT: DataSize: 0 Index: test/wasm/weak-alias.ll =================================================================== --- test/wasm/weak-alias.ll +++ test/wasm/weak-alias.ll @@ -30,8 +30,8 @@ ; CHECK-NEXT: - ElemType: ANYFUNC ; CHECK-NEXT: Limits: ; CHECK-NEXT: Flags: [ HAS_MAX ] -; CHECK-NEXT: Initial: 0x00000002 -; CHECK-NEXT: Maximum: 0x00000002 +; CHECK-NEXT: Initial: 0x00000003 +; CHECK-NEXT: Maximum: 0x00000003 ; CHECK-NEXT: - Type: MEMORY ; CHECK-NEXT: Memories: ; CHECK-NEXT: - Initial: 0x00000002 @@ -73,7 +73,7 @@ ; CHECK-NEXT: - Offset: ; CHECK-NEXT: Opcode: I32_CONST ; CHECK-NEXT: Value: 1 -; CHECK-NEXT: Functions: [ 1 ] +; CHECK-NEXT: Functions: [ 1, 1 ] ; CHECK-NEXT: - Type: CODE ; CHECK-NEXT: Functions: ; CHECK-NEXT: - Locals: @@ -85,11 +85,13 @@ ; CHECK-NEXT: - Locals: ; CHECK-NEXT: Body: 1081808080000B ; CHECK-NEXT: - Locals: -; CHECK-NEXT: Body: 41010B -; CHECK-NEXT: - Locals: ; CHECK-NEXT: - Type: I32 ; CHECK-NEXT: Count: 2 ; CHECK-NEXT: Body: 23808080800041106B220024808080800020004181808080003602081081808080002101200041106A24808080800020010B +; CHECK-NEXT: - Locals: +; CHECK-NEXT: - Type: I32 +; CHECK-NEXT: Count: 2 +; CHECK-NEXT: Body: 23808080800041106B220024808080800020004182808080003602081081808080002101200041106A24808080800020010B ; CHECK-NEXT: - Type: CUSTOM ; CHECK-NEXT: Name: linking ; CHECK-NEXT: DataSize: 0