Skip to content

Commit

Permalink
Add test for issue-76375
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Oct 20, 2020
1 parent 7d4d64d commit af337e8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/ui/mir/auxiliary/issue_76375_aux.rs
@@ -0,0 +1,14 @@
// edition:2018
// compile-flags: -Z mir-opt-level=2 -Z unsound-mir-opts

#[inline(always)]
pub fn f(s: bool) -> String {
let a = "Hello world!".to_string();
let b = a;
let c = b;
if s {
c
} else {
String::new()
}
}
15 changes: 15 additions & 0 deletions src/test/ui/mir/issue-76375.rs
@@ -0,0 +1,15 @@
// edition:2018
// build-pass
// compile-flags: -Z mir-opt-level=2 -L.
// aux-build:issue_76375_aux.rs

#![crate_type = "lib"]

extern crate issue_76375_aux;

pub async fn g() {
issue_76375_aux::f(true);
h().await;
}

pub async fn h() {}

0 comments on commit af337e8

Please sign in to comment.