Skip to content

Commit

Permalink
parser: Add testcases for multiline strings
Browse files Browse the repository at this point in the history
Regression checks for Rust-GCC#1399

gcc/testsuite/ChangeLog:

	* rust/compile/multiline-string.rs: New test.
	* rust/execute/torture/multiline-string.rs: New test.
  • Loading branch information
CohenArthur committed Dec 25, 2024
1 parent d28cae5 commit 2a64b20
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
14 changes: 14 additions & 0 deletions gcc/testsuite/rust/compile/multiline-string.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
fn main() {
let _a = "gcc
rs";

let _b = "rust
c
gcc
rs";
}
13 changes: 13 additions & 0 deletions gcc/testsuite/rust/execute/torture/multiline-string.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// { dg-output "gcc\n\nrs" }

extern "C" {
fn printf(fmt: *const i8, ...);
}

fn main() {
let a = "gcc
rs\0";

unsafe { printf("%s\n\0" as *const str as *const i8, a as *const str as *const i8); }
}

0 comments on commit 2a64b20

Please sign in to comment.