Skip to content

Commit 22029a2

Browse files
committed
add regression test for issue #54685
1 parent 0a8629b commit 22029a2

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// min-llvm-version: 12.0
2+
// compile-flags: -C opt-level=3
3+
// run-pass
4+
5+
fn foo(_i: i32) -> i32 {
6+
1
7+
}
8+
fn bar(_i: i32) -> i32 {
9+
1
10+
}
11+
12+
fn main() {
13+
let x: fn(i32) -> i32 = foo;
14+
let y: fn(i32) -> i32 = bar;
15+
16+
let s1;
17+
if x == y {
18+
s1 = "same".to_string();
19+
} else {
20+
s1 = format!("{:?}, {:?}", x, y);
21+
}
22+
23+
let s2;
24+
if x == y {
25+
s2 = "same".to_string();
26+
} else {
27+
s2 = format!("{:?}, {:?}", x, y);
28+
}
29+
30+
assert_eq!(s1, s2);
31+
}

0 commit comments

Comments
 (0)