diff --git a/gcc/testsuite/rust/compile/multiline-string.rs b/gcc/testsuite/rust/compile/multiline-string.rs new file mode 100644 index 000000000000..fcd6fa812ed2 --- /dev/null +++ b/gcc/testsuite/rust/compile/multiline-string.rs @@ -0,0 +1,14 @@ +fn main() { + let _a = "gcc + + rs"; + + let _b = "rust + + c + gcc + + + + rs"; +} diff --git a/gcc/testsuite/rust/execute/torture/multiline-string.rs b/gcc/testsuite/rust/execute/torture/multiline-string.rs new file mode 100644 index 000000000000..152dbb34d232 --- /dev/null +++ b/gcc/testsuite/rust/execute/torture/multiline-string.rs @@ -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); } +}