summaryrefslogtreecommitdiff
path: root/test/interp/atomic-rmw-and.txt
blob: d4d9f6103c3e3154ff3ebb20b1ffdc1781438a39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
;;; TOOL: run-interp
;;; ARGS*: --enable-threads
(module
  (memory 1 1 shared)

  ;; i32

  (func (export "i32.atomic.rmw8.and_u-result") (result i32)
    i32.const 0 i32.const 1000000 i32.store
    i32.const 0 i32.const 64      i32.atomic.rmw8.and_u)

  (func (export "i32.atomic.rmw8.and_u-memory") (result i32)
    i32.const 0 i32.const 1000000 i32.store
    i32.const 0 i32.const 64      i32.atomic.rmw8.and_u drop
    i32.const 0 i32.load8_u)

  (func (export "i32.atomic.rmw16.and_u-result") (result i32)
    i32.const 0 i32.const 1000000 i32.store
    i32.const 0 i32.const 64      i32.atomic.rmw16.and_u)

  (func (export "i32.atomic.rmw16.and_u-memory") (result i32)
    i32.const 0 i32.const 1000000 i32.store
    i32.const 0 i32.const 64      i32.atomic.rmw16.and_u drop
    i32.const 0 i32.load16_u)

  (func (export "i32.atomic.rmw.and-result") (result i32)
    i32.const 0 i32.const 1000000 i32.store
    i32.const 0 i32.const 64      i32.atomic.rmw.and)

  (func (export "i32.atomic.rmw.and-memory") (result i32)
    i32.const 0 i32.const 1000000 i32.store
    i32.const 0 i32.const 64      i32.atomic.rmw.and drop
    i32.const 0 i32.load)


  ;; i64

  (func (export "i64.atomic.rmw8.and_u-result") (result i64)
    i32.const 0 i64.const 10000000000 i64.store
    i32.const 0 i64.const 64          i64.atomic.rmw8.and_u)

  (func (export "i64.atomic.rmw8.and_u-memory") (result i64)
    i32.const 0 i64.const 10000000000 i64.store
    i32.const 0 i64.const 64          i64.atomic.rmw8.and_u drop
    i32.const 0 i64.load8_u)

  (func (export "i64.atomic.rmw16.and_u-result") (result i64)
    i32.const 0 i64.const 10000000000 i64.store
    i32.const 0 i64.const 1024        i64.atomic.rmw16.and_u)

  (func (export "i64.atomic.rmw16.and_u-memory") (result i64)
    i32.const 0 i64.const 10000000000 i64.store
    i32.const 0 i64.const 1024        i64.atomic.rmw16.and_u drop
    i32.const 0 i64.load16_u)

  (func (export "i64.atomic.rmw32.and_u-result") (result i64)
    i32.const 0 i64.const 10000000000 i64.store
    i32.const 0 i64.const 1024        i64.atomic.rmw32.and_u)

  (func (export "i64.atomic.rmw32.and_u-memory") (result i64)
    i32.const 0 i64.const 10000000000 i64.store
    i32.const 0 i64.const 1024        i64.atomic.rmw32.and_u drop
    i32.const 0 i64.load32_u)

  (func (export "i64.atomic.rmw.and-result") (result i64)
    i32.const 0 i64.const 10000000000 i64.store
    i32.const 0 i64.const 1024        i64.atomic.rmw.and)

  (func (export "i64.atomic.rmw.and-memory") (result i64)
    i32.const 0 i64.const 10000000000 i64.store
    i32.const 0 i64.const 1024        i64.atomic.rmw.and drop
    i32.const 0 i64.load)


  ;; Test bad alignment

  (func (export "bad_align-i32.atomic.rmw16.and_u")
    i32.const 1 i32.const 0 i32.atomic.rmw16.and_u drop)
  (func (export "bad_align-i32.atomic.rmw.and")
    i32.const 2 i32.const 0 i32.atomic.rmw.and drop)

  (func (export "bad_align-i64.atomic.rmw16.and_u")
    i32.const 1 i64.const 0 i64.atomic.rmw16.and_u drop)
  (func (export "bad_align-i64.atomic.rmw32.and_u")
    i32.const 2 i64.const 0 i64.atomic.rmw32.and_u drop)
  (func (export "bad_align-i64.atomic.rmw.and")
    i32.const 4 i64.const 0 i64.atomic.rmw.and drop)

)
(;; STDOUT ;;;
i32.atomic.rmw8.and_u-result() => i32:64
i32.atomic.rmw8.and_u-memory() => i32:64
i32.atomic.rmw16.and_u-result() => i32:16960
i32.atomic.rmw16.and_u-memory() => i32:64
i32.atomic.rmw.and-result() => i32:1000000
i32.atomic.rmw.and-memory() => i32:64
i64.atomic.rmw8.and_u-result() => i64:0
i64.atomic.rmw8.and_u-memory() => i64:0
i64.atomic.rmw16.and_u-result() => i64:58368
i64.atomic.rmw16.and_u-memory() => i64:1024
i64.atomic.rmw32.and_u-result() => i64:1410065408
i64.atomic.rmw32.and_u-memory() => i64:1024
i64.atomic.rmw.and-result() => i64:10000000000
i64.atomic.rmw.and-memory() => i64:1024
bad_align-i32.atomic.rmw16.and_u() => error: invalid atomic access at 1+0
bad_align-i32.atomic.rmw.and() => error: invalid atomic access at 2+0
bad_align-i64.atomic.rmw16.and_u() => error: invalid atomic access at 1+0
bad_align-i64.atomic.rmw32.and_u() => error: invalid atomic access at 2+0
bad_align-i64.atomic.rmw.and() => error: invalid atomic access at 4+0
;;; STDOUT ;;)