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" ) ) ;
0 commit comments