summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/bigint/asUintN.js
blob: 07e1d9b6acf9d88cb5b73165cbd8d3521f21e5f3 (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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
const tests = [
  [-0x10000000000000001n, 0, 0n],
  [-0x10000000000000000n, 0, 0n],
  [-0xffffffffffffffffn, 0, 0n],
  [-0xfffffffffffffffen, 0, 0n],
  [-0x8000000000000001n, 0, 0n],
  [-0x8000000000000000n, 0, 0n],
  [-0x7fffffffffffffffn, 0, 0n],
  [-0x7ffffffffffffffen, 0, 0n],
  [-0x100000001n, 0, 0n],
  [-0x100000000n, 0, 0n],
  [-0xffffffffn, 0, 0n],
  [-0xfffffffen, 0, 0n],
  [-0x80000001n, 0, 0n],
  [-0x80000000n, 0, 0n],
  [-0x7fffffffn, 0, 0n],
  [-0x7ffffffen, 0, 0n],
  [-9n, 0, 0n],
  [-8n, 0, 0n],
  [-7n, 0, 0n],
  [-6n, 0, 0n],
  [-5n, 0, 0n],
  [-4n, 0, 0n],
  [-3n, 0, 0n],
  [-2n, 0, 0n],
  [-1n, 0, 0n],
  [0n, 0, 0n],
  [1n, 0, 0n],
  [2n, 0, 0n],
  [3n, 0, 0n],
  [4n, 0, 0n],
  [5n, 0, 0n],
  [6n, 0, 0n],
  [7n, 0, 0n],
  [8n, 0, 0n],
  [9n, 0, 0n],
  [0x7ffffffen, 0, 0n],
  [0x7fffffffn, 0, 0n],
  [0x80000000n, 0, 0n],
  [0x80000001n, 0, 0n],
  [0xfffffffen, 0, 0n],
  [0xffffffffn, 0, 0n],
  [0x100000000n, 0, 0n],
  [0x100000001n, 0, 0n],
  [0x7ffffffffffffffen, 0, 0n],
  [0x7fffffffffffffffn, 0, 0n],
  [0x8000000000000000n, 0, 0n],
  [0x8000000000000001n, 0, 0n],
  [0xfffffffffffffffen, 0, 0n],
  [0xffffffffffffffffn, 0, 0n],
  [0x10000000000000000n, 0, 0n],
  [0x10000000000000001n, 0, 0n],
  [-0x10000000000000001n, 1, 1n],
  [-0x10000000000000000n, 1, 0n],
  [-0xffffffffffffffffn, 1, 1n],
  [-0xfffffffffffffffen, 1, 0n],
  [-0x8000000000000001n, 1, 1n],
  [-0x8000000000000000n, 1, 0n],
  [-0x7fffffffffffffffn, 1, 1n],
  [-0x7ffffffffffffffen, 1, 0n],
  [-0x100000001n, 1, 1n],
  [-0x100000000n, 1, 0n],
  [-0xffffffffn, 1, 1n],
  [-0xfffffffen, 1, 0n],
  [-0x80000001n, 1, 1n],
  [-0x80000000n, 1, 0n],
  [-0x7fffffffn, 1, 1n],
  [-0x7ffffffen, 1, 0n],
  [-9n, 1, 1n],
  [-8n, 1, 0n],
  [-7n, 1, 1n],
  [-6n, 1, 0n],
  [-5n, 1, 1n],
  [-4n, 1, 0n],
  [-3n, 1, 1n],
  [-2n, 1, 0n],
  [-1n, 1, 1n],
  [0n, 1, 0n],
  [1n, 1, 1n],
  [2n, 1, 0n],
  [3n, 1, 1n],
  [4n, 1, 0n],
  [5n, 1, 1n],
  [6n, 1, 0n],
  [7n, 1, 1n],
  [8n, 1, 0n],
  [9n, 1, 1n],
  [0x7ffffffen, 1, 0n],
  [0x7fffffffn, 1, 1n],
  [0x80000000n, 1, 0n],
  [0x80000001n, 1, 1n],
  [0xfffffffen, 1, 0n],
  [0xffffffffn, 1, 1n],
  [0x100000000n, 1, 0n],
  [0x100000001n, 1, 1n],
  [0x7ffffffffffffffen, 1, 0n],
  [0x7fffffffffffffffn, 1, 1n],
  [0x8000000000000000n, 1, 0n],
  [0x8000000000000001n, 1, 1n],
  [0xfffffffffffffffen, 1, 0n],
  [0xffffffffffffffffn, 1, 1n],
  [0x10000000000000000n, 1, 0n],
  [0x10000000000000001n, 1, 1n],
  [-0x10000000000000001n, 2, 3n],
  [-0x10000000000000000n, 2, 0n],
  [-0xffffffffffffffffn, 2, 1n],
  [-0xfffffffffffffffen, 2, 2n],
  [-0x8000000000000001n, 2, 3n],
  [-0x8000000000000000n, 2, 0n],
  [-0x7fffffffffffffffn, 2, 1n],
  [-0x7ffffffffffffffen, 2, 2n],
  [-0x100000001n, 2, 3n],
  [-0x100000000n, 2, 0n],
  [-0xffffffffn, 2, 1n],
  [-0xfffffffen, 2, 2n],
  [-0x80000001n, 2, 3n],
  [-0x80000000n, 2, 0n],
  [-0x7fffffffn, 2, 1n],
  [-0x7ffffffen, 2, 2n],
  [-9n, 2, 3n],
  [-8n, 2, 0n],
  [-7n, 2, 1n],
  [-6n, 2, 2n],
  [-5n, 2, 3n],
  [-4n, 2, 0n],
  [-3n, 2, 1n],
  [-2n, 2, 2n],
  [-1n, 2, 3n],
  [0n, 2, 0n],
  [1n, 2, 1n],
  [2n, 2, 2n],
  [3n, 2, 3n],
  [4n, 2, 0n],
  [5n, 2, 1n],
  [6n, 2, 2n],
  [7n, 2, 3n],
  [8n, 2, 0n],
  [9n, 2, 1n],
  [0x7ffffffen, 2, 2n],
  [0x7fffffffn, 2, 3n],
  [0x80000000n, 2, 0n],
  [0x80000001n, 2, 1n],
  [0xfffffffen, 2, 2n],
  [0xffffffffn, 2, 3n],
  [0x100000000n, 2, 0n],
  [0x100000001n, 2, 1n],
  [0x7ffffffffffffffen, 2, 2n],
  [0x7fffffffffffffffn, 2, 3n],
  [0x8000000000000000n, 2, 0n],
  [0x8000000000000001n, 2, 1n],
  [0xfffffffffffffffen, 2, 2n],
  [0xffffffffffffffffn, 2, 3n],
  [0x10000000000000000n, 2, 0n],
  [0x10000000000000001n, 2, 1n],
  [-0x10000000000000001n, 31, 0x7fffffffn],
  [-0x10000000000000000n, 31, 0n],
  [-0xffffffffffffffffn, 31, 1n],
  [-0xfffffffffffffffen, 31, 2n],
  [-0x8000000000000001n, 31, 0x7fffffffn],
  [-0x8000000000000000n, 31, 0n],
  [-0x7fffffffffffffffn, 31, 1n],
  [-0x7ffffffffffffffen, 31, 2n],
  [-0x100000001n, 31, 0x7fffffffn],
  [-0x100000000n, 31, 0n],
  [-0xffffffffn, 31, 1n],
  [-0xfffffffen, 31, 2n],
  [-0x80000001n, 31, 0x7fffffffn],
  [-0x80000000n, 31, 0n],
  [-0x7fffffffn, 31, 1n],
  [-0x7ffffffen, 31, 2n],
  [-9n, 31, 0x7ffffff7n],
  [-8n, 31, 0x7ffffff8n],
  [-7n, 31, 0x7ffffff9n],
  [-6n, 31, 0x7ffffffan],
  [-5n, 31, 0x7ffffffbn],
  [-4n, 31, 0x7ffffffcn],
  [-3n, 31, 0x7ffffffdn],
  [-2n, 31, 0x7ffffffen],
  [-1n, 31, 0x7fffffffn],
  [0n, 31, 0n],
  [1n, 31, 1n],
  [2n, 31, 2n],
  [3n, 31, 3n],
  [4n, 31, 4n],
  [5n, 31, 5n],
  [6n, 31, 6n],
  [7n, 31, 7n],
  [8n, 31, 8n],
  [9n, 31, 9n],
  [0x7ffffffen, 31, 0x7ffffffen],
  [0x7fffffffn, 31, 0x7fffffffn],
  [0x80000000n, 31, 0n],
  [0x80000001n, 31, 1n],
  [0xfffffffen, 31, 0x7ffffffen],
  [0xffffffffn, 31, 0x7fffffffn],
  [0x100000000n, 31, 0n],
  [0x100000001n, 31, 1n],
  [0x7ffffffffffffffen, 31, 0x7ffffffen],
  [0x7fffffffffffffffn, 31, 0x7fffffffn],
  [0x8000000000000000n, 31, 0n],
  [0x8000000000000001n, 31, 1n],
  [0xfffffffffffffffen, 31, 0x7ffffffen],
  [0xffffffffffffffffn, 31, 0x7fffffffn],
  [0x10000000000000000n, 31, 0n],
  [0x10000000000000001n, 31, 1n],
  [-0x10000000000000001n, 32, 0xffffffffn],
  [-0x10000000000000000n, 32, 0n],
  [-0xffffffffffffffffn, 32, 1n],
  [-0xfffffffffffffffen, 32, 2n],
  [-0x8000000000000001n, 32, 0xffffffffn],
  [-0x8000000000000000n, 32, 0n],
  [-0x7fffffffffffffffn, 32, 1n],
  [-0x7ffffffffffffffen, 32, 2n],
  [-0x100000001n, 32, 0xffffffffn],
  [-0x100000000n, 32, 0n],
  [-0xffffffffn, 32, 1n],
  [-0xfffffffen, 32, 2n],
  [-0x80000001n, 32, 0x7fffffffn],
  [-0x80000000n, 32, 0x80000000n],
  [-0x7fffffffn, 32, 0x80000001n],
  [-0x7ffffffen, 32, 0x80000002n],
  [-9n, 32, 0xfffffff7n],
  [-8n, 32, 0xfffffff8n],
  [-7n, 32, 0xfffffff9n],
  [-6n, 32, 0xfffffffan],
  [-5n, 32, 0xfffffffbn],
  [-4n, 32, 0xfffffffcn],
  [-3n, 32, 0xfffffffdn],
  [-2n, 32, 0xfffffffen],
  [-1n, 32, 0xffffffffn],
  [0n, 32, 0n],
  [1n, 32, 1n],
  [2n, 32, 2n],
  [3n, 32, 3n],
  [4n, 32, 4n],
  [5n, 32, 5n],
  [6n, 32, 6n],
  [7n, 32, 7n],
  [8n, 32, 8n],
  [9n, 32, 9n],
  [0x7ffffffen, 32, 0x7ffffffen],
  [0x7fffffffn, 32, 0x7fffffffn],
  [0x80000000n, 32, 0x80000000n],
  [0x80000001n, 32, 0x80000001n],
  [0xfffffffen, 32, 0xfffffffen],
  [0xffffffffn, 32, 0xffffffffn],
  [0x100000000n, 32, 0n],
  [0x100000001n, 32, 1n],
  [0x7ffffffffffffffen, 32, 0xfffffffen],
  [0x7fffffffffffffffn, 32, 0xffffffffn],
  [0x8000000000000000n, 32, 0n],
  [0x8000000000000001n, 32, 1n],
  [0xfffffffffffffffen, 32, 0xfffffffen],
  [0xffffffffffffffffn, 32, 0xffffffffn],
  [0x10000000000000000n, 32, 0n],
  [0x10000000000000001n, 32, 1n],
  [-0x10000000000000001n, 33, 0x1ffffffffn],
  [-0x10000000000000000n, 33, 0n],
  [-0xffffffffffffffffn, 33, 1n],
  [-0xfffffffffffffffen, 33, 2n],
  [-0x8000000000000001n, 33, 0x1ffffffffn],
  [-0x8000000000000000n, 33, 0n],
  [-0x7fffffffffffffffn, 33, 1n],
  [-0x7ffffffffffffffen, 33, 2n],
  [-0x100000001n, 33, 0xffffffffn],
  [-0x100000000n, 33, 0x100000000n],
  [-0xffffffffn, 33, 0x100000001n],
  [-0xfffffffen, 33, 0x100000002n],
  [-0x80000001n, 33, 0x17fffffffn],
  [-0x80000000n, 33, 0x180000000n],
  [-0x7fffffffn, 33, 0x180000001n],
  [-0x7ffffffen, 33, 0x180000002n],
  [-9n, 33, 0x1fffffff7n],
  [-8n, 33, 0x1fffffff8n],
  [-7n, 33, 0x1fffffff9n],
  [-6n, 33, 0x1fffffffan],
  [-5n, 33, 0x1fffffffbn],
  [-4n, 33, 0x1fffffffcn],
  [-3n, 33, 0x1fffffffdn],
  [-2n, 33, 0x1fffffffen],
  [-1n, 33, 0x1ffffffffn],
  [0n, 33, 0n],
  [1n, 33, 1n],
  [2n, 33, 2n],
  [3n, 33, 3n],
  [4n, 33, 4n],
  [5n, 33, 5n],
  [6n, 33, 6n],
  [7n, 33, 7n],
  [8n, 33, 8n],
  [9n, 33, 9n],
  [0x7ffffffen, 33, 0x7ffffffen],
  [0x7fffffffn, 33, 0x7fffffffn],
  [0x80000000n, 33, 0x80000000n],
  [0x80000001n, 33, 0x80000001n],
  [0xfffffffen, 33, 0xfffffffen],
  [0xffffffffn, 33, 0xffffffffn],
  [0x100000000n, 33, 0x100000000n],
  [0x100000001n, 33, 0x100000001n],
  [0x7ffffffffffffffen, 33, 0x1fffffffen],
  [0x7fffffffffffffffn, 33, 0x1ffffffffn],
  [0x8000000000000000n, 33, 0n],
  [0x8000000000000001n, 33, 1n],
  [0xfffffffffffffffen, 33, 0x1fffffffen],
  [0xffffffffffffffffn, 33, 0x1ffffffffn],
  [0x10000000000000000n, 33, 0n],
  [0x10000000000000001n, 33, 1n],
  [-0x10000000000000001n, 63, 0x7fffffffffffffffn],
  [-0x10000000000000000n, 63, 0n],
  [-0xffffffffffffffffn, 63, 1n],
  [-0xfffffffffffffffen, 63, 2n],
  [-0x8000000000000001n, 63, 0x7fffffffffffffffn],
  [-0x8000000000000000n, 63, 0n],
  [-0x7fffffffffffffffn, 63, 1n],
  [-0x7ffffffffffffffen, 63, 2n],
  [-0x100000001n, 63, 0x7ffffffeffffffffn],
  [-0x100000000n, 63, 0x7fffffff00000000n],
  [-0xffffffffn, 63, 0x7fffffff00000001n],
  [-0xfffffffen, 63, 0x7fffffff00000002n],
  [-0x80000001n, 63, 0x7fffffff7fffffffn],
  [-0x80000000n, 63, 0x7fffffff80000000n],
  [-0x7fffffffn, 63, 0x7fffffff80000001n],
  [-0x7ffffffen, 63, 0x7fffffff80000002n],
  [-9n, 63, 0x7ffffffffffffff7n],
  [-8n, 63, 0x7ffffffffffffff8n],
  [-7n, 63, 0x7ffffffffffffff9n],
  [-6n, 63, 0x7ffffffffffffffan],
  [-5n, 63, 0x7ffffffffffffffbn],
  [-4n, 63, 0x7ffffffffffffffcn],
  [-3n, 63, 0x7ffffffffffffffdn],
  [-2n, 63, 0x7ffffffffffffffen],
  [-1n, 63, 0x7fffffffffffffffn],
  [0n, 63, 0n],
  [1n, 63, 1n],
  [2n, 63, 2n],
  [3n, 63, 3n],
  [4n, 63, 4n],
  [5n, 63, 5n],
  [6n, 63, 6n],
  [7n, 63, 7n],
  [8n, 63, 8n],
  [9n, 63, 9n],
  [0x7ffffffen, 63, 0x7ffffffen],
  [0x7fffffffn, 63, 0x7fffffffn],
  [0x80000000n, 63, 0x80000000n],
  [0x80000001n, 63, 0x80000001n],
  [0xfffffffen, 63, 0xfffffffen],
  [0xffffffffn, 63, 0xffffffffn],
  [0x100000000n, 63, 0x100000000n],
  [0x100000001n, 63, 0x100000001n],
  [0x7ffffffffffffffen, 63, 0x7ffffffffffffffen],
  [0x7fffffffffffffffn, 63, 0x7fffffffffffffffn],
  [0x8000000000000000n, 63, 0n],
  [0x8000000000000001n, 63, 1n],
  [0xfffffffffffffffen, 63, 0x7ffffffffffffffen],
  [0xffffffffffffffffn, 63, 0x7fffffffffffffffn],
  [0x10000000000000000n, 63, 0n],
  [0x10000000000000001n, 63, 1n],
  [-0x10000000000000001n, 64, 0xffffffffffffffffn],
  [-0x10000000000000000n, 64, 0n],
  [-0xffffffffffffffffn, 64, 1n],
  [-0xfffffffffffffffen, 64, 2n],
  [-0x8000000000000001n, 64, 0x7fffffffffffffffn],
  [-0x8000000000000000n, 64, 0x8000000000000000n],
  [-0x7fffffffffffffffn, 64, 0x8000000000000001n],
  [-0x7ffffffffffffffen, 64, 0x8000000000000002n],
  [-0x100000001n, 64, 0xfffffffeffffffffn],
  [-0x100000000n, 64, 0xffffffff00000000n],
  [-0xffffffffn, 64, 0xffffffff00000001n],
  [-0xfffffffen, 64, 0xffffffff00000002n],
  [-0x80000001n, 64, 0xffffffff7fffffffn],
  [-0x80000000n, 64, 0xffffffff80000000n],
  [-0x7fffffffn, 64, 0xffffffff80000001n],
  [-0x7ffffffen, 64, 0xffffffff80000002n],
  [-9n, 64, 0xfffffffffffffff7n],
  [-8n, 64, 0xfffffffffffffff8n],
  [-7n, 64, 0xfffffffffffffff9n],
  [-6n, 64, 0xfffffffffffffffan],
  [-5n, 64, 0xfffffffffffffffbn],
  [-4n, 64, 0xfffffffffffffffcn],
  [-3n, 64, 0xfffffffffffffffdn],
  [-2n, 64, 0xfffffffffffffffen],
  [-1n, 64, 0xffffffffffffffffn],
  [0n, 64, 0n],
  [1n, 64, 1n],
  [2n, 64, 2n],
  [3n, 64, 3n],
  [4n, 64, 4n],
  [5n, 64, 5n],
  [6n, 64, 6n],
  [7n, 64, 7n],
  [8n, 64, 8n],
  [9n, 64, 9n],
  [0x7ffffffen, 64, 0x7ffffffen],
  [0x7fffffffn, 64, 0x7fffffffn],
  [0x80000000n, 64, 0x80000000n],
  [0x80000001n, 64, 0x80000001n],
  [0xfffffffen, 64, 0xfffffffen],
  [0xffffffffn, 64, 0xffffffffn],
  [0x100000000n, 64, 0x100000000n],
  [0x100000001n, 64, 0x100000001n],
  [0x7ffffffffffffffen, 64, 0x7ffffffffffffffen],
  [0x7fffffffffffffffn, 64, 0x7fffffffffffffffn],
  [0x8000000000000000n, 64, 0x8000000000000000n],
  [0x8000000000000001n, 64, 0x8000000000000001n],
  [0xfffffffffffffffen, 64, 0xfffffffffffffffen],
  [0xffffffffffffffffn, 64, 0xffffffffffffffffn],
  [0x10000000000000000n, 64, 0n],
  [0x10000000000000001n, 64, 1n],
  [-0x10000000000000001n, 65, 0xffffffffffffffffn],
  [-0x10000000000000000n, 65, 0x10000000000000000n],
  [-0xffffffffffffffffn, 65, 0x10000000000000001n],
  [-0xfffffffffffffffen, 65, 0x10000000000000002n],
  [-0x8000000000000001n, 65, 0x17fffffffffffffffn],
  [-0x8000000000000000n, 65, 0x18000000000000000n],
  [-0x7fffffffffffffffn, 65, 0x18000000000000001n],
  [-0x7ffffffffffffffen, 65, 0x18000000000000002n],
  [-0x100000001n, 65, 0x1fffffffeffffffffn],
  [-0x100000000n, 65, 0x1ffffffff00000000n],
  [-0xffffffffn, 65, 0x1ffffffff00000001n],
  [-0xfffffffen, 65, 0x1ffffffff00000002n],
  [-0x80000001n, 65, 0x1ffffffff7fffffffn],
  [-0x80000000n, 65, 0x1ffffffff80000000n],
  [-0x7fffffffn, 65, 0x1ffffffff80000001n],
  [-0x7ffffffen, 65, 0x1ffffffff80000002n],
  [-9n, 65, 0x1fffffffffffffff7n],
  [-8n, 65, 0x1fffffffffffffff8n],
  [-7n, 65, 0x1fffffffffffffff9n],
  [-6n, 65, 0x1fffffffffffffffan],
  [-5n, 65, 0x1fffffffffffffffbn],
  [-4n, 65, 0x1fffffffffffffffcn],
  [-3n, 65, 0x1fffffffffffffffdn],
  [-2n, 65, 0x1fffffffffffffffen],
  [-1n, 65, 0x1ffffffffffffffffn],
  [0n, 65, 0n],
  [1n, 65, 1n],
  [2n, 65, 2n],
  [3n, 65, 3n],
  [4n, 65, 4n],
  [5n, 65, 5n],
  [6n, 65, 6n],
  [7n, 65, 7n],
  [8n, 65, 8n],
  [9n, 65, 9n],
  [0x7ffffffen, 65, 0x7ffffffen],
  [0x7fffffffn, 65, 0x7fffffffn],
  [0x80000000n, 65, 0x80000000n],
  [0x80000001n, 65, 0x80000001n],
  [0xfffffffen, 65, 0xfffffffen],
  [0xffffffffn, 65, 0xffffffffn],
  [0x100000000n, 65, 0x100000000n],
  [0x100000001n, 65, 0x100000001n],
  [0x7ffffffffffffffen, 65, 0x7ffffffffffffffen],
  [0x7fffffffffffffffn, 65, 0x7fffffffffffffffn],
  [0x8000000000000000n, 65, 0x8000000000000000n],
  [0x8000000000000001n, 65, 0x8000000000000001n],
  [0xfffffffffffffffen, 65, 0xfffffffffffffffen],
  [0xffffffffffffffffn, 65, 0xffffffffffffffffn],
  [0x10000000000000000n, 65, 0x10000000000000000n],
  [0x10000000000000001n, 65, 0x10000000000000001n],
];

function f(tests) {
  for (let test of tests) {
    let input = test[0], bits = test[1], expected = test[2];

    assertEq(BigInt.asUintN(bits, input), expected);
  }
}

for (let i = 0; i < 10; ++i) {
  f(tests);
}