Skip to content

Commit 0e9b874

Browse files
CohenArthurdkm
authored andcommitted
parser: Add testcases for multiline strings
Regression checks for #1399 gcc/testsuite/ChangeLog: * rust/compile/multiline-string.rs: New test. * rust/execute/torture/multiline-string.rs: New test.
1 parent f9af412 commit 0e9b874

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// { dg-output "gcc\n\nrs\n" }
2+
3+
extern "C" {
4+
fn printf(fmt: *const i8, ...);
5+
}
6+
7+
fn main() -> i32 {
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+
14+
0
15+
}

0 commit comments

Comments
 (0)