Skip to content

Commit e9d08e5

Browse files
committed
gccrs: Add tests for Unicode identifiers
gcc/testsuite/ChangeLog: * rust/compile/torture/raw_identifiers.rs: New test. * rust/compile/torture/utf8_identifiers.rs: New test. Signed-off-by: Raiki Tamura <[email protected]>
1 parent 760ed46 commit e9d08e5

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
pub fn square(num: i32) -> i32 {
22
r#num * num
33
}
4+
5+
pub fn kimchi() -> i32 {
6+
// UTF-8 raw indentifiers
7+
let r#김치 = 1;
8+
let r#泡菜 = 1;
9+
let r#кимчи = 1;
10+
r#김치 + r#泡菜 + r#кимчи
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
pub fn f() {
2+
let crab = ();
3+
4+
let Κάβουρας = 0.001;
5+
// { dg-warning "unused name" "" { target *-*-* } .-1 }
6+
let 게 = "";
7+
// { dg-warning "unused name" "" { target *-*-* } .-1 }
8+
let سلطعون = 0.;
9+
// { dg-warning "unused name" "" { target *-*-* } .-1 }
10+
11+
let _: &'かに () = &crab;
12+
}
13+
14+
pub fn g<'β, γ>() {}
15+
16+
struct _S {
17+
δ: i32
18+
}

0 commit comments

Comments
 (0)