Add test for issue-76375

This commit is contained in:
Yuki Okushi 2020-10-20 17:07:41 +09:00
parent 7d4d64d69f
commit af337e87e2
2 changed files with 29 additions and 0 deletions

View File

@ -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()
}
}

View File

@ -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() {}