1- // only-x86_64
1+ // needs-asm-support
22
33#![ feature( asm_const) ]
44
@@ -38,6 +38,9 @@ fn main() {
3838 //~^ ERROR expected one of
3939 asm ! ( "{}" , options( ) , const foo) ;
4040 //~^ ERROR attempt to use a non-constant value in a constant
41+
42+ // test that asm!'s clobber_abi doesn't accept non-string literals
43+ // see also https://github.com/rust-lang/rust/issues/112635
4144 asm ! ( "" , clobber_abi( ) ) ;
4245 //~^ ERROR at least one abi must be provided
4346 asm ! ( "" , clobber_abi( foo) ) ;
@@ -46,6 +49,25 @@ fn main() {
4649 //~^ ERROR expected one of `)` or `,`, found `foo`
4750 asm ! ( "" , clobber_abi( "C" , foo) ) ;
4851 //~^ ERROR expected string literal
52+ asm ! ( "" , clobber_abi( 1 ) ) ;
53+ //~^ ERROR expected string literal
54+ asm ! ( "" , clobber_abi( ( ) ) ) ;
55+ //~^ ERROR expected string literal
56+ asm ! ( "" , clobber_abi( uwu) ) ;
57+ //~^ ERROR expected string literal
58+ asm ! ( "" , clobber_abi( { } ) ) ;
59+ //~^ ERROR expected string literal
60+ asm ! ( "" , clobber_abi( loop { } ) ) ;
61+ //~^ ERROR expected string literal
62+ asm ! ( "" , clobber_abi( if ) ) ;
63+ //~^ ERROR expected string literal
64+ asm ! ( "" , clobber_abi( do) ) ;
65+ //~^ ERROR expected string literal
66+ asm ! ( "" , clobber_abi( <) ) ;
67+ //~^ ERROR expected string literal
68+ asm ! ( "" , clobber_abi( . ) ) ;
69+ //~^ ERROR expected string literal
70+
4971 asm ! ( "{}" , clobber_abi( "C" ) , const foo) ;
5072 //~^ ERROR attempt to use a non-constant value in a constant
5173 asm ! ( "" , options( ) , clobber_abi( "C" ) ) ;
@@ -56,15 +78,7 @@ fn main() {
5678 //~^^ ERROR argument never used
5779 //~^^^ ERROR attempt to use a non-constant value in a constant
5880 //~^^^^ ERROR attempt to use a non-constant value in a constant
59- asm ! ( "" , a = in( "eax" ) foo) ;
60- //~^ ERROR explicit register arguments cannot have names
61- asm ! ( "{a}" , in( "eax" ) foo, a = const bar) ;
62- //~^ ERROR attempt to use a non-constant value in a constant
63- asm ! ( "{a}" , in( "eax" ) foo, a = const bar) ;
64- //~^ ERROR attempt to use a non-constant value in a constant
65- asm ! ( "{1}" , in( "eax" ) foo, const bar) ;
66- //~^ ERROR positional arguments cannot follow named arguments or explicit register arguments
67- //~^^ ERROR attempt to use a non-constant value in a constant
81+
6882 asm ! ( "" , options( ) , "" ) ;
6983 //~^ ERROR expected one of
7084 asm ! ( "{}" , in( reg) foo, "{}" , out( reg) foo) ;
0 commit comments