mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 04:57:19 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			46 lines
		
	
	
		
			743 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			46 lines
		
	
	
		
			743 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // ignore-aarch64
 | |
| // ignore-arm
 | |
| // ignore-avr
 | |
| // ignore-bpf
 | |
| // ignore-bpf
 | |
| // ignore-hexagon
 | |
| // ignore-mips
 | |
| // ignore-mips64
 | |
| // ignore-msp430
 | |
| // ignore-powerpc64
 | |
| // ignore-powerpc
 | |
| // ignore-sparc
 | |
| // ignore-sparc64
 | |
| // ignore-s390x
 | |
| // ignore-thumb
 | |
| // ignore-nvptx64
 | |
| // ignore-spirv
 | |
| // ignore-wasm32
 | |
| // ignore-wasm64
 | |
| // ignore-emscripten
 | |
| // compile-flags: -C no-prepopulate-passes
 | |
| 
 | |
| #![crate_type = "lib"]
 | |
| 
 | |
| use std::arch::global_asm;
 | |
| 
 | |
| // CHECK-LABEL: foo
 | |
| // CHECK: module asm
 | |
| // this regex will capture the correct unconditional branch inst.
 | |
| // CHECK: module asm "{{[[:space:]]+}}jmp baz"
 | |
| global_asm!(
 | |
|     r#"
 | |
|     .global foo
 | |
| foo:
 | |
|     jmp baz
 | |
| "#
 | |
| );
 | |
| 
 | |
| extern "C" {
 | |
|     fn foo();
 | |
| }
 | |
| 
 | |
| // CHECK-LABEL: @baz
 | |
| #[no_mangle]
 | |
| pub unsafe extern "C" fn baz() {}
 | 
