93 lines · plain
1# RUN: llvm-mc -filetype=obj -triple=wasm64-unknown-unknown %s -o %t.o2# RUN: wasm-ld -mwasm64 --export-dynamic -o %t.wasm %t.o3# RUN: llvm-objdump -d %t.wasm | FileCheck %s4# RUN: wasm-ld -mwasm64 --export-dynamic -O2 -o %t-opt.wasm %t.o5# RUN: llvm-objdump -d %t-opt.wasm | FileCheck %s6# RUN: wasm-ld -mwasm64 --export-dynamic --strip-debug --compress-relocations -o %t-compressed.wasm %t.o7# RUN: llvm-objdump -d %t-compressed.wasm | FileCheck %s -check-prefix=COMPRESS8 9 .globl _start10_start:11 .functype _start () -> ()12 end_function13 14 .globl func_ret_i6415func_ret_i64:16 .functype func_ret_i64 () -> (i64)17 i64.const 118 end_function19 20 .globl func_ret_i3221func_ret_i32:22 .functype func_ret_i32 () -> (i32)23 i32.const 224 end_function25 26 .globl test_memory_and_indirect_call_relocs27test_memory_and_indirect_call_relocs:28 .functype test_memory_and_indirect_call_relocs () -> ()29 i64.const indirect_func_ret_i64 # R_WASM_MEMORY_ADDR_SLEB6430 drop31 i64.const 032 i64.load indirect_func_ret_i32 # R_WASM_MEMORY_ADDR_LEB6433 drop34 i64.const func_ret_i64 # R_WASM_TABLE_INDEX_SLEB6435 drop36 end_function37 38# CHECK: test_memory_and_indirect_call_relocs39# CHECK: 42 90 80 84 80 80 80 80 80 80 00 i64.const 6555240# CHECK: 29 03 98 80 84 80 80 80 80 80 80 00 i64.load 6556041# CHECK: 42 81 80 80 80 80 80 80 80 80 00 i64.const 142# COMPRESS: test_memory_and_indirect_call_relocs43# COMPRESS: 42 90 80 04 i64.const 6555244# COMPRESS: 29 03 98 80 04 i64.load 6556045# COMPRESS: 42 01 i64.const 146 47 .globl test_relative_relocs48test_relative_relocs:49 .functype test_relative_relocs () -> ()50 i64.const indirect_func_ret_i64@MBREL # R_WASM_MEMORY_ADDR_REL_SLEB6451 drop52 i64.const func_ret_i32@TBREL # R_WASM_TABLE_INDEX_REL_SLEB6453 drop54 i64.const i32_tls_data@TLSREL # R_WASM_MEMORY_ADDR_TLS_SLEB6455 drop56 end_function57 58# CHECK: test_relative_relocs59# CHECK: 42 90 80 84 80 80 80 80 80 80 00 i64.const 6555260# CHECK: 42 81 80 80 80 80 80 80 80 80 00 i64.const 161# CHECK: 42 83 80 80 80 80 80 80 80 80 00 i64.const 362# COMPRESS: test_relative_relocs63# COMPRESS: 42 90 80 04 i64.const 6555264# COMPRESS: 42 01 i64.const 165# COMPRESS: 42 03 i64.const 366 67 .section .tdata,"T",@68 .int8 069 .int8 070 .int8 071i32_tls_data:72 .int32 6573 .size i32_tls_data, 474 75 .section .data,"",@76 .p2align 477indirect_func_ret_i64:78 .int64 func_ret_i6479 .size indirect_func_ret_i64, 880 81indirect_func_ret_i32:82 .int64 func_ret_i3283 .size indirect_func_ret_i32, 884 85.section .custom_section.target_features,"",@86 .int8 287 .int8 4388 .int8 789 .ascii "atomics"90 .int8 4391 .int8 1192 .ascii "bulk-memory"93