Skip to content

Commit ca23203

Browse files
committed
Fix rustc test suite
1 parent 2d8a0c1 commit ca23203

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

scripts/test_rustc_tests.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ rm -r tests/run-make/c-link-to-rust-va-list-fn # requires callee side vararg sup
4949
rm tests/ui/c-variadic/valid.rs # same
5050
rm tests/ui/c-variadic/trait-method.rs # same
5151
rm tests/ui/c-variadic/inherent-method.rs # same
52+
rm tests/ui/sanitizer/kcfi-c-variadic.rs # same
5253
rm tests/ui/c-variadic/same-program-multiple-abis-x86_64.rs # variadics for calling conventions other than C unsupported
5354
rm tests/ui/delegation/fn-header.rs
5455

@@ -62,6 +63,7 @@ rm tests/ui/asm/x86_64/issue-96797.rs # const and sym inline asm operands don't
6263
rm tests/ui/asm/global-asm-mono-sym-fn.rs # same
6364
rm tests/ui/asm/naked-asm-mono-sym-fn.rs # same
6465
rm tests/ui/asm/x86_64/goto.rs # inline asm labels not supported
66+
rm tests/ui/asm/label-operand.rs # same
6567
rm tests/ui/simd/simd-bitmask-notpow2.rs # non-pow-of-2 simd vector sizes
6668
rm -r tests/run-make/used-proc-macro # used(linker) isn't supported yet
6769
rm tests/ui/linking/no-gc-encapsulation-symbols.rs # same

src/constant.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,7 @@ pub(crate) fn codegen_const_value<'tcx>(
141141
let base_addr = match fx.tcx.global_alloc(alloc_id) {
142142
GlobalAlloc::Memory(alloc) => {
143143
if alloc.inner().len() == 0 {
144-
let val = alloc.inner().align.bytes().wrapping_add(offset.bytes());
145-
fx.bcx.ins().iconst(
146-
fx.pointer_type,
147-
fx.tcx.truncate_to_target_usize(val) as i64,
148-
)
144+
fx.bcx.ins().iconst(fx.pointer_type, alloc.inner().align.bytes() as i64)
149145
} else {
150146
let data_id = data_id_for_alloc_id(
151147
&mut fx.constants_cx,
@@ -213,7 +209,9 @@ pub(crate) fn codegen_const_value<'tcx>(
213209
}
214210
};
215211
let val = if offset.bytes() != 0 {
216-
fx.bcx.ins().iadd_imm(base_addr, i64::try_from(offset.bytes()).unwrap())
212+
fx.bcx
213+
.ins()
214+
.iadd_imm(base_addr, fx.tcx.truncate_to_target_usize(offset.bytes()) as i64)
217215
} else {
218216
base_addr
219217
};

0 commit comments

Comments
 (0)