1 ; RUN: llc %s -o %t.o -filetype=obj
2 ; RUN: llvm-as %S/Inputs/used.ll -o %t1.o
3 ; RUN: wasm-ld %t.o %t1.o -o %t.wasm
4 ; RUN: obj2yaml %t.wasm | FileCheck %s
6 ; Verify that symbols references from regular objects are preserved by LTO
8 target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-n32:64-S128"
9 target triple = "wasm32-unknown-unknown"
13 @foo = external global i32
15 define void @_start() {
16 %val = load i32, ptr @foo, align 4
17 %tobool = icmp ne i32 %val, 0
18 br i1 %tobool, label %callbar, label %return
29 ; CHECK-NEXT: Segments:
30 ; CHECK-NEXT: - SectionOffset: 7
31 ; CHECK-NEXT: InitFlags: 0
33 ; CHECK-NEXT: Opcode: I32_CONST
34 ; CHECK-NEXT: Value: 1024
35 ; CHECK-NEXT: Content: '01000000'
37 ; CHECK: - Type: CUSTOM
38 ; CHECK-NEXT: Name: name
39 ; CHECK-NEXT: FunctionNames:
40 ; CHECK-NEXT: - Index: 0
41 ; CHECK-NEXT: Name: _start
42 ; CHECK-NEXT: - Index: 1
43 ; CHECK-NEXT: Name: bar