Fix tests

This commit is contained in:
Antoni Boucher 2023-08-13 15:34:21 -04:00
parent 607ec893e7
commit e3deac5c71
21 changed files with 29 additions and 5 deletions

@ -144,6 +144,9 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'_>, cgu_name: Symbol, target_info: Arc<
if env::var("CG_GCCJIT_DUMP_RTL").as_deref() == Ok("1") { if env::var("CG_GCCJIT_DUMP_RTL").as_deref() == Ok("1") {
context.add_command_line_option("-fdump-rtl-vregs"); context.add_command_line_option("-fdump-rtl-vregs");
} }
if env::var("CG_GCCJIT_DUMP_RTL_ALL").as_deref() == Ok("1") {
context.add_command_line_option("-fdump-rtl-all");
}
if env::var("CG_GCCJIT_DUMP_TREE_ALL").as_deref() == Ok("1") { if env::var("CG_GCCJIT_DUMP_TREE_ALL").as_deref() == Ok("1") {
context.add_command_line_option("-fdump-tree-all"); context.add_command_line_option("-fdump-tree-all");
} }

@ -546,7 +546,12 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
} }
pub fn gcc_uint(&self, typ: Type<'gcc>, int: u64) -> RValue<'gcc> { pub fn gcc_uint(&self, typ: Type<'gcc>, int: u64) -> RValue<'gcc> {
if self.is_native_int_type_or_bool(typ) { if typ.is_u128(self) {
// FIXME(antoyo): libgccjit cannot create 128-bit values yet.
let num = self.context.new_rvalue_from_long(self.u64_type, int as i64);
self.gcc_int_cast(num, typ)
}
else if self.is_native_int_type_or_bool(typ) {
self.context.new_rvalue_from_long(typ, u64::try_from(int).expect("u64::try_from") as i64) self.context.new_rvalue_from_long(typ, u64::try_from(int).expect("u64::try_from") as i64)
} }
else { else {
@ -572,6 +577,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
} }
} }
else if typ.is_i128(self) { else if typ.is_i128(self) {
// FIXME(antoyo): libgccjit cannot create 128-bit values yet.
let num = self.context.new_rvalue_from_long(self.u64_type, num as u64 as i64); let num = self.context.new_rvalue_from_long(self.u64_type, num as u64 as i64);
self.gcc_int_cast(num, typ) self.gcc_int_cast(num, typ)
} }

@ -4,6 +4,7 @@
// status: signal // status: signal
#![feature(auto_traits, lang_items, no_core, start, intrinsics)] #![feature(auto_traits, lang_items, no_core, start, intrinsics)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]

@ -4,6 +4,7 @@
// status: signal // status: signal
#![feature(auto_traits, lang_items, no_core, start, intrinsics)] #![feature(auto_traits, lang_items, no_core, start, intrinsics)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]

@ -8,6 +8,7 @@
// 10 // 10
#![feature(arbitrary_self_types, auto_traits, lang_items, no_core, start, intrinsics)] #![feature(arbitrary_self_types, auto_traits, lang_items, no_core, start, intrinsics)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]

@ -5,7 +5,7 @@
// 7 8 // 7 8
// 10 // 10
#![allow(unused_attributes)] #![allow(internal_features, unused_attributes)]
#![feature(auto_traits, lang_items, no_core, start, intrinsics, track_caller)] #![feature(auto_traits, lang_items, no_core, start, intrinsics, track_caller)]
#![no_std] #![no_std]

@ -10,6 +10,7 @@
#![feature(arbitrary_self_types, auto_traits, lang_items, no_core, start, intrinsics, #![feature(arbitrary_self_types, auto_traits, lang_items, no_core, start, intrinsics,
unboxed_closures)] unboxed_closures)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]

@ -6,6 +6,7 @@
// 1 // 1
#![feature(arbitrary_self_types, auto_traits, lang_items, no_core, start, intrinsics)] #![feature(arbitrary_self_types, auto_traits, lang_items, no_core, start, intrinsics)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]

@ -4,6 +4,7 @@
// status: 0 // status: 0
#![feature(auto_traits, lang_items, no_core, start)] #![feature(auto_traits, lang_items, no_core, start)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]

@ -4,6 +4,7 @@
// status: 2 // status: 2
#![feature(auto_traits, lang_items, no_core, start, intrinsics)] #![feature(auto_traits, lang_items, no_core, start, intrinsics)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]

@ -4,6 +4,7 @@
// status: 1 // status: 1
#![feature(auto_traits, lang_items, no_core, start)] #![feature(auto_traits, lang_items, no_core, start)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]

@ -5,6 +5,7 @@
// stdout: 1 // stdout: 1
#![feature(arbitrary_self_types, auto_traits, lang_items, no_core, start, intrinsics)] #![feature(arbitrary_self_types, auto_traits, lang_items, no_core, start, intrinsics)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]

@ -4,7 +4,7 @@
// stdout: Success // stdout: Success
// status: signal // status: signal
#![allow(unused_attributes)] #![allow(internal_features, unused_attributes)]
#![feature(auto_traits, lang_items, no_core, start, intrinsics)] #![feature(auto_traits, lang_items, no_core, start, intrinsics)]
#![no_std] #![no_std]

@ -7,7 +7,7 @@
// 6 // 6
// 11 // 11
#![allow(unused_attributes)] #![allow(internal_features, unused_attributes)]
#![feature(auto_traits, lang_items, no_core, start, intrinsics, track_caller)] #![feature(auto_traits, lang_items, no_core, start, intrinsics, track_caller)]
#![no_std] #![no_std]

@ -5,7 +5,7 @@
// 39 // 39
// 10 // 10
#![allow(unused_attributes)] #![allow(internal_features, unused_attributes)]
#![feature(auto_traits, lang_items, no_core, start, intrinsics, arbitrary_self_types)] #![feature(auto_traits, lang_items, no_core, start, intrinsics, arbitrary_self_types)]
#![no_std] #![no_std]

@ -5,6 +5,7 @@
// stdout: 1 // stdout: 1
#![feature(arbitrary_self_types, auto_traits, lang_items, no_core, start, intrinsics)] #![feature(arbitrary_self_types, auto_traits, lang_items, no_core, start, intrinsics)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]

@ -7,6 +7,7 @@
// 42 // 42
#![feature(auto_traits, lang_items, no_core, start, intrinsics)] #![feature(auto_traits, lang_items, no_core, start, intrinsics)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]

@ -5,6 +5,7 @@
// stdout: 5 // stdout: 5
#![feature(arbitrary_self_types, auto_traits, lang_items, no_core, start, intrinsics)] #![feature(arbitrary_self_types, auto_traits, lang_items, no_core, start, intrinsics)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]

@ -10,6 +10,7 @@
// 1 // 1
#![feature(auto_traits, lang_items, no_core, start, intrinsics)] #![feature(auto_traits, lang_items, no_core, start, intrinsics)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]

@ -6,6 +6,7 @@
// 2 // 2
#![feature(auto_traits, lang_items, no_core, start, intrinsics)] #![feature(auto_traits, lang_items, no_core, start, intrinsics)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]

@ -5,6 +5,7 @@
// stdout: 3 // stdout: 3
#![feature(auto_traits, lang_items, no_core, start, intrinsics)] #![feature(auto_traits, lang_items, no_core, start, intrinsics)]
#![allow(internal_features)]
#![no_std] #![no_std]
#![no_core] #![no_core]