Skip to content

Commit a51abe3

Browse files
committed
parser: Add testcases for multiline strings
Regression checks for Rust-GCC#1399 gcc/testsuite/ChangeLog: * rust/compile/multiline-string.rs: New test. * rust/execute/torture/multiline-string.rs: New test.
1 parent d28cae5 commit a51abe3

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
fn main() {
2+
let _a = "gcc
3+
4+
rs";
5+
6+
let _b = "rust
7+
8+
c
9+
gcc
10+
11+
12+
13+
rs";
14+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// { dg-output "gcc\n\n\nrs" }
2+
3+
extern "C" {
4+
fn printf(fmt: *const i8, ...);
5+
}
6+
7+
fn main() {
8+
let a = "gcc
9+
10+
rs\0";
11+
12+
unsafe { printf("%s\n\0" as *const str as *const i8, a as *const str as *const i8); }
13+
}

0 commit comments

Comments
 (0)