Sam Clegg | 16c1682 | 2018-05-10 22:16:44 +0000 | [diff] [blame] | 1 | # RUN: llvm-mc --disassemble %s -triple=wasm32-unknown-unknown | FileCheck %s |
| 2 | |
| 3 | # CHECK: .text |
| 4 | |
| 5 | # CHECK: nop |
| 6 | 0x01 |
| 7 | |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 8 | # CHECK: i32.add |
Sam Clegg | 16c1682 | 2018-05-10 22:16:44 +0000 | [diff] [blame] | 9 | 0x6a |
| 10 | |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 11 | # CHECK: i64.const -1 |
Sam Clegg | 16c1682 | 2018-05-10 22:16:44 +0000 | [diff] [blame] | 12 | 0x42 0x7F |
| 13 | |
Wouter van Oortmerssen | 8a9cb24 | 2018-08-27 15:45:51 +0000 | [diff] [blame^] | 14 | # CHECK: i64.load32_u 16:p2align=1 |
Sam Clegg | 16c1682 | 2018-05-10 22:16:44 +0000 | [diff] [blame] | 15 | 0x35 0x01 0x10 |
| 16 | |
| 17 | # CHECK: block |
| 18 | # 3 |
| 19 | # FIXME: WebAssemblyInstPrinter does not currently print block number. |
| 20 | 0x02 0x03 |
| 21 | |
| 22 | # CHECK: call_indirect |
| 23 | # $0=, 128, 0 |
| 24 | # FIXME: WebAssemblyInstPrinter does not print immediates. |
| 25 | 0x11 0x80 0x01 0x00 |
| 26 | |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 27 | # CHECK: get_local 128 |
Sam Clegg | 16c1682 | 2018-05-10 22:16:44 +0000 | [diff] [blame] | 28 | 0x20 0x80 0x01 |
| 29 | |
| 30 | # Prefix byte example: |
Wouter van Oortmerssen | 48dac31 | 2018-06-18 21:22:44 +0000 | [diff] [blame] | 31 | # CHECK: i64.trunc_u:sat/f64 |
Sam Clegg | 16c1682 | 2018-05-10 22:16:44 +0000 | [diff] [blame] | 32 | 0xFC 0x07 |
Thomas Lively | 2244292 | 2018-08-21 21:03:18 +0000 | [diff] [blame] | 33 | |
| 34 | # v128.const is arbitrarily disassembled as v2f64 |
| 35 | # CHECK: v128.const 0x1.60504030201p-911, 0x1.e0d0c0b0a0908p-783 |
| 36 | 0xFD 0x00 0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F |