Skip to content

Commit 75d5834

Browse files
committed
Auto merge of #143126 - dianqk:update-llvm, r=nikic
Update LLVM submodule Fixes #140686, fixes #141913, fixes #142752, fixes #143399.
2 parents 5adb489 + 1339b90 commit 75d5834

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

tests/ui/darwin-ld64.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//@ compile-flags: -Copt-level=3 -Ccodegen-units=256 -Clink-arg=-ld_classic
2+
//@ run-pass
3+
//@ only-x86_64-apple-darwin
4+
5+
// This is a regression test for https://github.com/rust-lang/rust/issues/140686.
6+
// Although this is a ld64(ld-classic) bug, we still need to support it
7+
// due to cross-compilation and support for older Xcode.
8+
9+
fn main() {
10+
let dst: Vec<u8> = Vec::new();
11+
let len = broken_func(std::hint::black_box(2), dst);
12+
assert_eq!(len, 8);
13+
}
14+
15+
#[inline(never)]
16+
pub fn broken_func(version: usize, mut dst: Vec<u8>) -> usize {
17+
match version {
18+
1 => dst.extend_from_slice(b"aaaaaaaa"),
19+
2 => dst.extend_from_slice(b"bbbbbbbb"),
20+
3 => dst.extend_from_slice(b"bbbbbbbb"),
21+
_ => panic!(),
22+
}
23+
dst.len()
24+
}

0 commit comments

Comments
 (0)