Skip to content

Commit 18caf88

Browse files
committed
Auto merge of #107879 - icedrocket:update-llvm, r=cuviper
Update LLVM submodule Fixes #105626
2 parents 864b625 + 565de58 commit 18caf88

File tree

4 files changed

+35
-10
lines changed

4 files changed

+35
-10
lines changed

src/bootstrap/config/tests.rs

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ fn parse(config: &str) -> Config {
1111

1212
#[test]
1313
fn download_ci_llvm() {
14+
if crate::native::is_ci_llvm_modified(&parse("")) {
15+
eprintln!("Detected LLVM as non-available: running in CI and modified LLVM in this change");
16+
return;
17+
}
18+
1419
let parse_llvm = |s| parse(s).llvm_from_ci;
1520
let if_available = parse_llvm("llvm.download-ci-llvm = \"if-available\"");
1621

src/bootstrap/native.rs

+12-9
Original file line numberDiff line numberDiff line change
@@ -216,21 +216,24 @@ pub(crate) fn is_ci_llvm_available(config: &Config, asserts: bool) -> bool {
216216
}
217217
}
218218

219-
if CiEnv::is_ci() {
219+
if is_ci_llvm_modified(config) {
220+
eprintln!("Detected LLVM as non-available: running in CI and modified LLVM in this change");
221+
return false;
222+
}
223+
224+
true
225+
}
226+
227+
/// Returns true if we're running in CI with modified LLVM (and thus can't download it)
228+
pub(crate) fn is_ci_llvm_modified(config: &Config) -> bool {
229+
CiEnv::is_ci() && {
220230
// We assume we have access to git, so it's okay to unconditionally pass
221231
// `true` here.
222232
let llvm_sha = detect_llvm_sha(config, true);
223233
let head_sha = output(config.git().arg("rev-parse").arg("HEAD"));
224234
let head_sha = head_sha.trim();
225-
if llvm_sha == head_sha {
226-
eprintln!(
227-
"Detected LLVM as non-available: running in CI and modified LLVM in this change"
228-
);
229-
return false;
230-
}
235+
llvm_sha == head_sha
231236
}
232-
233-
true
234237
}
235238

236239
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// run-pass
2+
// only-x86
3+
// min-system-llvm-version: 16
4+
// compile-flags: -Ctarget-feature=+sse2
5+
6+
use std::hint::black_box;
7+
8+
fn main() {
9+
let n: i64 = black_box(0x3fffffdfffffff);
10+
let r = f32::from_bits(0x5a7fffff);
11+
12+
assert_ne!((n as f64) as f32, n as f32);
13+
14+
// FIXME: these assertions fail if only x87 is enabled
15+
assert_eq!(n as i64 as f32, r);
16+
assert_eq!(n as u64 as f32, r);
17+
}

0 commit comments

Comments
 (0)