diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2025-07-30 13:11:52 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2025-08-05 16:36:59 +0200 |
commit | 697025acf8bedcc59a2e34035ddb6f17a69b8c52 (patch) | |
tree | 70e65bf58e036662b378465dde71ed15d1fdb377 /gcc/testsuite/rust | |
parent | a9fdfc065c3710a26b8a77d2c5d3fc73f4be8371 (diff) | |
download | gcc-697025acf8bedcc59a2e34035ddb6f17a69b8c52.zip gcc-697025acf8bedcc59a2e34035ddb6f17a69b8c52.tar.gz gcc-697025acf8bedcc59a2e34035ddb6f17a69b8c52.tar.bz2 |
gccrs: Fix infinite loop with missing comma
A missing comma between inline assembly templates did not throw an error
and looped indefinitely.
gcc/rust/ChangeLog:
* expand/rust-macro-builtins-asm.cc (parse_format_strings): Emit an
error when expecting a comma.
gcc/testsuite/ChangeLog:
* rust/compile/issue-4006.rs: New test.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/testsuite/rust')
-rw-r--r-- | gcc/testsuite/rust/compile/issue-4006.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/rust/compile/issue-4006.rs b/gcc/testsuite/rust/compile/issue-4006.rs new file mode 100644 index 0000000..328c7b6 --- /dev/null +++ b/gcc/testsuite/rust/compile/issue-4006.rs @@ -0,0 +1,13 @@ +#![feature(rustc_attrs)] + +#[rustc_builtin_macro] +macro_rules! asm { + () => {}; +} + +pub fn main() { + asm!( + "xor eax, eax" + "xor eax, eax"); + // { dg-error "expected token .;." "" { target *-*-* } .-1 } +} |