1 ; RUN: llvm-as %s -o %t.o
2 ; RUN: wasm-ld %t.o -o %t.wasm --allow-undefined
3 ; RUN: obj2yaml %t.wasm | FileCheck %s
5 target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128"
6 target triple = "wasm32-unknown-unknown"
10 ; Symbols such as foo which are only called indirectly are handled slightly
11 ; differently with respect to signature checking.
14 @ptr = global i8* bitcast (i32 ()* @foo to i8*), align 8
15 ; Ensure access to ptr is not inlined below, even under LTO
16 @llvm.used = appending global [1 x i8**] [i8** @ptr], section "llvm.metadata"
18 define void @_start() {
21 %addr = load i32 ()*, i32 ()** bitcast (i8** @ptr to i32 ()**), align 8
27 ; CHECK: - Type: IMPORT
28 ; CHECK-NEXT: Imports:
29 ; CHECK-NEXT: - Module: env
30 ; CHECK-NEXT: Field: bar
31 ; CHECK-NEXT: Kind: FUNCTION
32 ; CHECK-NEXT: SigIndex: 0
33 ; CHECK-NEXT: - Module: env
34 ; CHECK-NEXT: Field: foo
35 ; CHECK-NEXT: Kind: FUNCTION
36 ; CHECK-NEXT: SigIndex: 0