[AMDGPU][True16][CodeGen] true16 codegen pattern for v_med3_u/i16 (#121850)
[llvm-project.git] / llvm / test / MC / WebAssembly / reference-types.s
blobcfadede8295ef6f6135b5c681c986bece36eb1d4
1 # RUN: llvm-mc -show-encoding -triple=wasm32-unknown-unknown -mattr=+reference-types < %s | FileCheck %s
2 # RUN: llvm-mc -show-encoding -triple=wasm64-unknown-unknown -mattr=+reference-types < %s | FileCheck %s
4 # CHECK-LABEL:ref_is_null:
5 # CHECK: ref.is_null # encoding: [0xd1]
6 ref_is_null:
7 .functype ref_is_null () -> (i32, i32, i32)
8 ref.null_extern
9 ref.is_null
10 ref.null_func
11 ref.is_null
12 ref.null_exn
13 ref.is_null
14 end_function
16 # CHECK-LABEL: ref_null_test:
17 # CHECK: ref.null_func # encoding: [0xd0,0x70]
18 # CHECK: ref.null_extern # encoding: [0xd0,0x6f]
19 # CHECK: ref.null_exn # encoding: [0xd0,0x69]
20 ref_null_test:
21 .functype ref_null_test () -> ()
22 ref.null_func
23 drop
24 ref.null_extern
25 drop
26 ref.null_exn
27 drop
28 end_function
30 # CHECK-LABEL: ref_sig_test_funcref:
31 # CHECK-NEXT: .functype ref_sig_test_funcref (funcref) -> (funcref)
32 ref_sig_test_funcref:
33 .functype ref_sig_test_funcref (funcref) -> (funcref)
34 local.get 0
35 end_function
37 # CHECK-LABEL: ref_sig_test_externref:
38 # CHECK-NEXT: .functype ref_sig_test_externref (externref) -> (externref)
39 ref_sig_test_externref:
40 .functype ref_sig_test_externref (externref) -> (externref)
41 local.get 0
42 end_function
44 # CHECK-LABEL: ref_sig_test_exnref:
45 # CHECK-NEXT: .functype ref_sig_test_exnref (exnref) -> (exnref)
46 ref_sig_test_exnref:
47 .functype ref_sig_test_exnref (exnref) -> (exnref)
48 local.get 0
49 end_function
51 # CHECK-LABEL: ref_select_test:
52 # CHECK: funcref.select # encoding: [0x1b]
53 # CHECK: externref.select # encoding: [0x1b]
54 # CHECK: exnref.select # encoding: [0x1b]
55 ref_select_test:
56 .functype ref_select_test () -> ()
57 ref.null_func
58 ref.null_func
59 i32.const 0
60 funcref.select
61 drop
62 ref.null_extern
63 ref.null_extern
64 i32.const 0
65 externref.select
66 drop
67 ref.null_exn
68 ref.null_exn
69 i32.const 0
70 exnref.select
71 drop
72 end_function
74 # CHECK-LABEL: ref_block_test:
75 # CHECK: block funcref
76 # CHECK: block externref
77 # CHECK: block exnref
78 ref_block_test:
79 .functype ref_block_test () -> ()
80 block funcref
81 block externref
82 block exnref
83 ref.null_exn
84 end_block
85 drop
86 ref.null_extern
87 end_block
88 drop
89 ref.null_func
90 end_block
91 drop
92 end_function