mirror of
				https://github.com/tc39/test262.git
				synced 2025-10-31 19:53:50 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			472 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			472 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| //@ runBigIntEnabled
 | |
| 
 | |
| let assert = {
 | |
|     sameValue: function(i, e) {
 | |
|         if (i !== e)
 | |
|             throw new Error(m);
 | |
|     }
 | |
| }
 | |
| 
 | |
| function bigIntBitXor(a, b) {
 | |
|     return (a ^ b) ^ (a ^ 0b11n);
 | |
| 
 | |
| }
 | |
| noInline(bigIntBitXor);
 | |
| 
 | |
| for (let i = 0; i < 10000; i++) {
 | |
|     let r = bigIntBitXor(0b11n, 0b1010n);
 | |
|     assert.sameValue(r, 0b1001n);
 | |
| }
 | |
| 
 | |
| for (let i = 0; i < 10000; i++) {
 | |
|     let r = bigIntBitXor(0xfffafafaf19281fefafeafebcn, 0b1010n);
 | |
|     assert.sameValue(r, 0b1001n);
 | |
| }
 | |
| 
 |