another inline asm test + disable on msvc
							parent
							
								
									2964bf9e23
								
							
						
					
					
						commit
						6c51d0bb78
					
				| 
						 | 
					@ -1,8 +1,11 @@
 | 
				
			||||||
fn test_inline_asm() {
 | 
					fn test_inline_asm() {
 | 
				
			||||||
 | 
						$if !windows {
 | 
				
			||||||
 | 
						$if !tinyc {
 | 
				
			||||||
	a := 10
 | 
						a := 10
 | 
				
			||||||
	b := 0
 | 
						b := 0
 | 
				
			||||||
	unsafe {
 | 
						unsafe {
 | 
				
			||||||
		asm ("movl %1, %%eax;"
 | 
							asm (
 | 
				
			||||||
 | 
								"movl %1, %%eax;"
 | 
				
			||||||
			"movl %%eax, %0;"
 | 
								"movl %%eax, %0;"
 | 
				
			||||||
			:"=r"(b)
 | 
								:"=r"(b)
 | 
				
			||||||
			:"r"(a)
 | 
								:"r"(a)
 | 
				
			||||||
| 
						 | 
					@ -11,4 +14,15 @@ fn test_inline_asm() {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	assert a == 10
 | 
						assert a == 10
 | 
				
			||||||
	assert b == 10
 | 
						assert b == 10
 | 
				
			||||||
 | 
						//
 | 
				
			||||||
 | 
						e := 0
 | 
				
			||||||
 | 
						unsafe {
 | 
				
			||||||
 | 
							asm(
 | 
				
			||||||
 | 
								"movl $5, %0"
 | 
				
			||||||
 | 
								:"=a"(e)
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						assert e == 5
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue