-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98dd81e
commit 9d3e35c
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// run-pass | ||
// compile-flags: -O -Zmir-opt-level=3 -Cno-prepopulate-passes | ||
// min-llvm-version: 16.0 (requires APFloat fixes in LLVM) | ||
|
||
// Regression test for a broken MIR optimization (issue #113407). | ||
pub fn main() { | ||
let f = f64::from_bits(0x19873cc2) as f32; | ||
assert_eq!(f.to_bits(), 0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// run-pass | ||
// compile-flags: -O -Zmir-opt-level=3 -Cno-prepopulate-passes | ||
|
||
// Regression test for a broken MIR optimization (issue #102403). | ||
pub fn f() -> f64 { | ||
std::hint::black_box(-1.0) % std::hint::black_box(-1.0) | ||
} | ||
|
||
pub fn g() -> f64 { | ||
-1.0 % -1.0 | ||
} | ||
|
||
pub fn main() { | ||
assert_eq!(f().signum(), g().signum()); | ||
} |