1
- // only-x86_64
1
+ // needs-asm-support
2
2
3
3
#![ feature( asm_const) ]
4
4
@@ -38,6 +38,9 @@ fn main() {
38
38
//~^ ERROR expected one of
39
39
asm ! ( "{}" , options( ) , const foo) ;
40
40
//~^ 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
41
44
asm ! ( "" , clobber_abi( ) ) ;
42
45
//~^ ERROR at least one abi must be provided
43
46
asm ! ( "" , clobber_abi( foo) ) ;
@@ -46,6 +49,25 @@ fn main() {
46
49
//~^ ERROR expected one of `)` or `,`, found `foo`
47
50
asm ! ( "" , clobber_abi( "C" , foo) ) ;
48
51
//~^ 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
+
49
71
asm ! ( "{}" , clobber_abi( "C" ) , const foo) ;
50
72
//~^ ERROR attempt to use a non-constant value in a constant
51
73
asm ! ( "" , options( ) , clobber_abi( "C" ) ) ;
0 commit comments