From 2d516877c9999da0639906a3312515d257d00b7a Mon Sep 17 00:00:00 2001 From: Daniel Kolsoi Date: Sat, 13 Jul 2024 14:19:01 -0400 Subject: [PATCH] commented out some tests --- tests/all/test_values.rs | 262 +++++++++++++++++++-------------------- 1 file changed, 131 insertions(+), 131 deletions(-) diff --git a/tests/all/test_values.rs b/tests/all/test_values.rs index 2729e0bafb0..94fa37aa5f5 100644 --- a/tests/all/test_values.rs +++ b/tests/all/test_values.rs @@ -387,122 +387,122 @@ use std::convert::TryFrom; // assert!(ppc_f128_undef.is_undef()); // } -#[llvm_versions(12..)] -#[test] -fn test_poison() { - let context = Context::create(); - let bool_type = context.bool_type(); - let i8_type = context.i8_type(); - let i16_type = context.i16_type(); - let i32_type = context.i32_type(); - let i64_type = context.i64_type(); - let i128_type = context.i128_type(); - let f16_type = context.f16_type(); - let f32_type = context.f32_type(); - let f64_type = context.f64_type(); - let f128_type = context.f128_type(); - #[cfg(any( - feature = "llvm15-0", - feature = "llvm16-0", - feature = "llvm17-0", - feature = "llvm18-0" - ))] - let ptr_type = context.ptr_type(AddressSpace::default()); - let array_type = f64_type.array_type(42); - let ppc_f128_type = context.ppc_f128_type(); - - assert_eq!(array_type.get_element_type().into_float_type(), f64_type); - - let bool_val = bool_type.const_int(0, false); - let i8_val = i8_type.const_int(0, false); - let i16_val = i16_type.const_int(0, false); - let i32_val = i32_type.const_int(0, false); - let i64_val = i64_type.const_int(0, false); - let i128_val = i128_type.const_int(0, false); - let f16_val = f16_type.const_float(0.0); - let f32_val = f32_type.const_float(0.0); - let f64_val = f64_type.const_float(0.0); - let f128_val = f128_type.const_float(0.0); - #[cfg(not(any( - feature = "llvm15-0", - feature = "llvm16-0", - feature = "llvm17-0", - feature = "llvm18-0" - )))] - let ptr_val = bool_type.ptr_type(AddressSpace::default()).const_null(); - #[cfg(any( - feature = "llvm15-0", - feature = "llvm16-0", - feature = "llvm17-0", - feature = "llvm18-0" - ))] - let ptr_val = ptr_type.const_null(); - let array_val = f64_type.const_array(&[f64_val]); - let struct_val = context.const_struct(&[i8_val.into(), f128_val.into()], false); - let vec_val = VectorType::const_vector(&[i8_val]); - let ppc_f128_val = ppc_f128_type.const_float(0.0); - - assert!(!bool_val.is_poison()); - assert!(!i8_val.is_poison()); - assert!(!i16_val.is_poison()); - assert!(!i32_val.is_poison()); - assert!(!i64_val.is_poison()); - assert!(!i128_val.is_poison()); - assert!(!f16_val.is_poison()); - assert!(!f32_val.is_poison()); - assert!(!f64_val.is_poison()); - assert!(!f128_val.is_poison()); - assert!(!ptr_val.is_poison()); - assert!(!array_val.is_poison()); - assert!(!struct_val.is_poison()); - assert!(!vec_val.is_poison()); - assert!(!ppc_f128_val.is_poison()); - - let bool_poison = bool_type.get_poison(); - let i8_poison = i8_type.get_poison(); - let i16_poison = i16_type.get_poison(); - let i32_poison = i32_type.get_poison(); - let i64_poison = i64_type.get_poison(); - let i128_poison = i128_type.get_poison(); - let f16_poison = f16_type.get_poison(); - let f32_poison = f32_type.get_poison(); - let f64_poison = f64_type.get_poison(); - let f128_poison = f128_type.get_poison(); - #[cfg(not(any( - feature = "llvm15-0", - feature = "llvm16-0", - feature = "llvm17-0", - feature = "llvm18-0" - )))] - let ptr_poison = bool_type.ptr_type(AddressSpace::default()).get_poison(); - #[cfg(any( - feature = "llvm15-0", - feature = "llvm16-0", - feature = "llvm17-0", - feature = "llvm18-0" - ))] - let ptr_poison = ptr_type.get_poison(); - let array_poison = array_type.get_poison(); - let struct_poison = context.struct_type(&[bool_type.into()], false).get_poison(); - let vec_poison = bool_type.vec_type(1).get_poison(); - let ppc_f128_poison = ppc_f128_type.get_poison(); - - assert!(bool_poison.is_poison()); - assert!(i8_poison.is_poison()); - assert!(i16_poison.is_poison()); - assert!(i32_poison.is_poison()); - assert!(i64_poison.is_poison()); - assert!(i128_poison.is_poison()); - assert!(f16_poison.is_poison()); - assert!(f32_poison.is_poison()); - assert!(f64_poison.is_poison()); - assert!(f128_poison.is_poison()); - assert!(ptr_poison.is_poison()); - assert!(array_poison.is_poison()); - assert!(struct_poison.is_poison()); - assert!(vec_poison.is_poison()); - assert!(ppc_f128_poison.is_poison()); -} +// #[llvm_versions(12..)] +// #[test] +// fn test_poison() { +// let context = Context::create(); +// let bool_type = context.bool_type(); +// let i8_type = context.i8_type(); +// let i16_type = context.i16_type(); +// let i32_type = context.i32_type(); +// let i64_type = context.i64_type(); +// let i128_type = context.i128_type(); +// let f16_type = context.f16_type(); +// let f32_type = context.f32_type(); +// let f64_type = context.f64_type(); +// let f128_type = context.f128_type(); +// #[cfg(any( +// feature = "llvm15-0", +// feature = "llvm16-0", +// feature = "llvm17-0", +// feature = "llvm18-0" +// ))] +// let ptr_type = context.ptr_type(AddressSpace::default()); +// let array_type = f64_type.array_type(42); +// let ppc_f128_type = context.ppc_f128_type(); + +// assert_eq!(array_type.get_element_type().into_float_type(), f64_type); + +// let bool_val = bool_type.const_int(0, false); +// let i8_val = i8_type.const_int(0, false); +// let i16_val = i16_type.const_int(0, false); +// let i32_val = i32_type.const_int(0, false); +// let i64_val = i64_type.const_int(0, false); +// let i128_val = i128_type.const_int(0, false); +// let f16_val = f16_type.const_float(0.0); +// let f32_val = f32_type.const_float(0.0); +// let f64_val = f64_type.const_float(0.0); +// let f128_val = f128_type.const_float(0.0); +// #[cfg(not(any( +// feature = "llvm15-0", +// feature = "llvm16-0", +// feature = "llvm17-0", +// feature = "llvm18-0" +// )))] +// let ptr_val = bool_type.ptr_type(AddressSpace::default()).const_null(); +// #[cfg(any( +// feature = "llvm15-0", +// feature = "llvm16-0", +// feature = "llvm17-0", +// feature = "llvm18-0" +// ))] +// let ptr_val = ptr_type.const_null(); +// let array_val = f64_type.const_array(&[f64_val]); +// let struct_val = context.const_struct(&[i8_val.into(), f128_val.into()], false); +// let vec_val = VectorType::const_vector(&[i8_val]); +// let ppc_f128_val = ppc_f128_type.const_float(0.0); + +// assert!(!bool_val.is_poison()); +// assert!(!i8_val.is_poison()); +// assert!(!i16_val.is_poison()); +// assert!(!i32_val.is_poison()); +// assert!(!i64_val.is_poison()); +// assert!(!i128_val.is_poison()); +// assert!(!f16_val.is_poison()); +// assert!(!f32_val.is_poison()); +// assert!(!f64_val.is_poison()); +// assert!(!f128_val.is_poison()); +// assert!(!ptr_val.is_poison()); +// assert!(!array_val.is_poison()); +// assert!(!struct_val.is_poison()); +// assert!(!vec_val.is_poison()); +// assert!(!ppc_f128_val.is_poison()); + +// let bool_poison = bool_type.get_poison(); +// let i8_poison = i8_type.get_poison(); +// let i16_poison = i16_type.get_poison(); +// let i32_poison = i32_type.get_poison(); +// let i64_poison = i64_type.get_poison(); +// let i128_poison = i128_type.get_poison(); +// let f16_poison = f16_type.get_poison(); +// let f32_poison = f32_type.get_poison(); +// let f64_poison = f64_type.get_poison(); +// let f128_poison = f128_type.get_poison(); +// #[cfg(not(any( +// feature = "llvm15-0", +// feature = "llvm16-0", +// feature = "llvm17-0", +// feature = "llvm18-0" +// )))] +// let ptr_poison = bool_type.ptr_type(AddressSpace::default()).get_poison(); +// #[cfg(any( +// feature = "llvm15-0", +// feature = "llvm16-0", +// feature = "llvm17-0", +// feature = "llvm18-0" +// ))] +// let ptr_poison = ptr_type.get_poison(); +// let array_poison = array_type.get_poison(); +// let struct_poison = context.struct_type(&[bool_type.into()], false).get_poison(); +// let vec_poison = bool_type.vec_type(1).get_poison(); +// let ppc_f128_poison = ppc_f128_type.get_poison(); + +// assert!(bool_poison.is_poison()); +// assert!(i8_poison.is_poison()); +// assert!(i16_poison.is_poison()); +// assert!(i32_poison.is_poison()); +// assert!(i64_poison.is_poison()); +// assert!(i128_poison.is_poison()); +// assert!(f16_poison.is_poison()); +// assert!(f32_poison.is_poison()); +// assert!(f64_poison.is_poison()); +// assert!(f128_poison.is_poison()); +// assert!(ptr_poison.is_poison()); +// assert!(array_poison.is_poison()); +// assert!(struct_poison.is_poison()); +// assert!(vec_poison.is_poison()); +// assert!(ppc_f128_poison.is_poison()); +// } #[test] fn test_consecutive_fns() { @@ -528,28 +528,28 @@ fn test_consecutive_fns() { assert!(function2.get_next_function().is_none()); } -// #[test] -// fn test_verify_fn() { -// let context = Context::create(); -// let builder = context.create_builder(); -// let module = context.create_module("fns"); +#[test] +fn test_verify_fn() { + let context = Context::create(); + let builder = context.create_builder(); + let module = context.create_module("fns"); -// let void_type = context.void_type(); -// let fn_type = void_type.fn_type(&[], false); + let void_type = context.void_type(); + let fn_type = void_type.fn_type(&[], false); -// let function = module.add_function("fn", fn_type, None); + let function = module.add_function("fn", fn_type, None); -// assert!(function.verify(false)); + assert!(function.verify(false)); -// let basic_block = context.append_basic_block(function, "entry"); + let basic_block = context.append_basic_block(function, "entry"); -// builder.position_at_end(basic_block); -// builder.build_return(None).unwrap(); + builder.position_at_end(basic_block); + builder.build_return(None).unwrap(); -// assert!(function.verify(false)); + assert!(function.verify(false)); -// // TODO: Verify other verify modes -// } + // TODO: Verify other verify modes +} // #[test] // fn test_metadata() {