diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 86a4c07..f797afc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,6 +66,8 @@ jobs: - name: 'Run smir integration tests' run: | + which jq + jq --version make integration-test ui-tests: diff --git a/src/printer.rs b/src/printer.rs index b949d20..d4f3694 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -24,7 +24,10 @@ use serde::{Serialize, Serializer}; use stable_mir::{ mir::mono::{Instance, InstanceKind, MonoItem}, mir::{alloc::AllocId, visit::MirVisitor, Body, LocalDecl, Rvalue, Terminator, TerminatorKind}, - ty::{AdtDef, Allocation, ConstDef, ForeignItemKind, IndexedVal, RigidTy, TyKind, VariantIdx}, + ty::{ + AdtDef, Allocation, ConstDef, ForeignItemKind, IndexedVal, RigidTy, TyConstKind, TyKind, + VariantIdx, + }, CrateDef, CrateItem, ItemKind, }; @@ -627,7 +630,15 @@ fn collect_ty(val_collector: &mut InternedValueCollector, val: stable_mir::ty::T .is_some() { match val.kind() { - RigidTy(Array(ty, _) | Pat(ty, _) | Slice(ty) | RawPtr(ty, _) | Ref(_, ty, _)) => { + RigidTy(Array(ty, ty_const)) => { + collect_ty(val_collector, ty); + match ty_const.kind() { + TyConstKind::Value(ty, _) => collect_ty(val_collector, *ty), + TyConstKind::ZSTValue(ty) => collect_ty(val_collector, *ty), + _ => (), + } + } + RigidTy(Pat(ty, _) | Slice(ty) | RawPtr(ty, _) | Ref(_, ty, _)) => { collect_ty(val_collector, ty) } RigidTy(Tuple(tys)) => collect_vec_tys(val_collector, tys), @@ -960,6 +971,17 @@ pub enum TypeMetadata { name: String, adt_def: AdtDef, }, + UnionType { + name: String, + adt_def: AdtDef, + }, + ArrayType(stable_mir::ty::Ty, Option), + PtrType(stable_mir::ty::Ty), + RefType(stable_mir::ty::Ty), + TupleType { + types: Vec, + }, + FunType(String), } fn mk_type_metadata( @@ -967,12 +989,14 @@ fn mk_type_metadata( k: stable_mir::ty::Ty, t: TyKind, ) -> Option<(stable_mir::ty::Ty, TypeMetadata)> { + use stable_mir::ty::RigidTy::*; + use TyKind::RigidTy as T; use TypeMetadata::*; match t { - TyKind::RigidTy(prim_type) if t.is_primitive() => Some((k, PrimitiveType(prim_type))), + T(prim_type) if t.is_primitive() => Some((k, PrimitiveType(prim_type))), // for enums, we need a mapping of variantIdx to discriminant // this requires access to the internals and is not provided as an interface function at the moment - TyKind::RigidTy(RigidTy::Adt(adt_def, _)) if t.is_enum() => { + T(Adt(adt_def, _)) if t.is_enum() => { let adt_internal = rustc_internal::internal(tcx, adt_def); let discriminants = adt_internal .discriminants(tcx) @@ -989,11 +1013,35 @@ fn mk_type_metadata( )) } // for structs, we record the name for information purposes - TyKind::RigidTy(RigidTy::Adt(adt_def, _)) if t.is_struct() => { + T(Adt(adt_def, _)) if t.is_struct() => { let name = adt_def.name(); Some((k, StructType { name, adt_def })) } - _ => None, + // for unions, we only record the name + T(Adt(adt_def, _)) if t.is_union() => { + let name = adt_def.name(); + Some((k, UnionType { name, adt_def })) + } + // encode str together with primitive types + T(Str) => Some((k, PrimitiveType(Str))), + // for arrays and slices, record element type and optional size + T(Array(ty, ty_const)) => Some((k, ArrayType(ty, Some(ty_const)))), + T(Slice(ty)) => Some((k, ArrayType(ty, None))), + // for raw pointers and references store the pointee type + T(RawPtr(ty, _)) => Some((k, PtrType(ty))), + T(Ref(_, ty, _)) => Some((k, RefType(ty))), + // for tuples the element types are provided + T(Tuple(tys)) => Some((k, TupleType { types: tys })), + // opaque function types (fun ptrs, closures, FnDef) are only provided to avoid dangling ty references + T(FnDef(_, _)) | T(FnPtr(_)) | T(Closure(_, _)) => Some((k, FunType(format!("{}", k)))), + // other types are not provided either + T(Foreign(_)) + | T(Pat(_, _)) + | T(Coroutine(_, _, _)) + | T(Dynamic(_, _, _)) + | T(CoroutineWitness(_, _)) => None, + TyKind::Alias(_, _) | TyKind::Param(_) | TyKind::Bound(_, _) => None, + _ => None, // redundant because of first 4 cases, but rustc does not understand that } } diff --git a/tests/integration/normalise-filter.jq b/tests/integration/normalise-filter.jq index a14d67d..c0c8ebd 100644 --- a/tests/integration/normalise-filter.jq +++ b/tests/integration/normalise-filter.jq @@ -1,27 +1,29 @@ # Remove the hashes at the end of mangled names .functions = ( [ .functions[] | if .[1].NormalSym then .[1].NormalSym = .[1].NormalSym[:-17] else . end ] ) | .items = ( [ .items[] | if .symbol_name then .symbol_name = .symbol_name[:-17] else . end ] ) +# delete unstable alloc, function, and type IDs + | .allocs = ( [ .allocs[] ] | map(del(.[0])) ) + | .functions = ( [ .functions[] ] | map(del(.[0])) ) + | .types = ( [ .types[] ] | map(del(.[0])) ) | # Apply the normalisation filter -{ allocs: - ( [ .allocs[] ] -# delete unstable alloc ID - | map(del(.[0])) - ), - functions: - ( [ .functions[] ] -# delete unstable function ID - | map(del(.[0])) - ), - items: - ( [ .items[] ] - ), - types: - ( [ .types[] ] -# delete unstable Ty ID (int, first in list) - | map(del(.[0])) -# delete unstable adt_def from Struct and Enum - | map(del(.[0].StructType.adt_def)) - | map(del(.[0].EnumType.adt_def)) - ) +{ allocs: .allocs, + functions: .functions, + items: .items, + types: ( [ +# sort by constructors and remove unstable IDs within each + ( .types | map(select(.[0].PrimitiveType)) ), + # delete unstable adt_ref IDs + ( .types | map(select(.[0].EnumType) | del(.[0].EnumType.adt_def)) ), + ( .types | map(select(.[0].StructType) | del(.[0].StructType.adt_def)) ), + ( .types | map(select(.[0].UnionType) | del(.[0].UnionType.adt_def)) ), + # delete unstable Ty IDs for arrays and tuples + ( .types | map(select(.[0].ArrayType) | del(.[0].ArrayType[0])) ), + ( .types | map(select(.[0].TupleType) | .[0].TupleType.types = "elided") ), + # replace unstable Ty IDs for references by zero + ( .types | map(select(.[0].PtrType) | .[0].PtrType = "elided") ), + ( .types | map(select(.[0].RefType) | .[0].RefType = "elided") ), + # keep function type strings + ( .types | map(select(.[0].FunType) | .[0].FunType = "elided") ) + ] | flatten(1) ) } diff --git a/tests/integration/programs/assert_eq.smir.json.expected b/tests/integration/programs/assert_eq.smir.json.expected index 23833ed..97fc321 100644 --- a/tests/integration/programs/assert_eq.smir.json.expected +++ b/tests/integration/programs/assert_eq.smir.json.expected @@ -3142,40 +3142,21 @@ ], [ { - "EnumType": { - "discriminants": [ - [ - 0, - 0 - ], - [ - 1, - 1 - ] - ], - "name": "std::result::Result" - } - } - ], - [ - { - "StructType": { - "name": "std::sys::pal::unix::process::process_common::ExitCode" + "PrimitiveType": { + "Int": "I32" } } ], [ { "PrimitiveType": { - "Int": "I32" + "Uint": "U32" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" - } + "PrimitiveType": "Bool" } ], [ @@ -3197,8 +3178,18 @@ ], [ { - "PrimitiveType": { - "Uint": "U32" + "EnumType": { + "discriminants": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "name": "std::result::Result" } } ], @@ -3242,7 +3233,16 @@ ], [ { - "PrimitiveType": "Bool" + "StructType": { + "name": "std::sys::pal::unix::process::process_common::ExitCode" + } + } + ], + [ + { + "StructType": { + "name": "std::process::ExitCode" + } } ], [ @@ -3265,6 +3265,169 @@ "name": "std::fmt::Formatter" } } + ], + [ + { + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } ] ] } diff --git a/tests/integration/programs/binop.smir.json.expected b/tests/integration/programs/binop.smir.json.expected index 4f79610..12e52a2 100644 --- a/tests/integration/programs/binop.smir.json.expected +++ b/tests/integration/programs/binop.smir.json.expected @@ -9733,6 +9733,30 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], + [ + { + "PrimitiveType": { + "Uint": "U32" + } + } + ], + [ + { + "PrimitiveType": "Str" + } + ], [ { "EnumType": { @@ -9759,36 +9783,143 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { "StructType": { - "name": "std::process::ExitCode" + "name": "std::panic::Location" } } ], [ { - "PrimitiveType": "Bool" + "TupleType": { + "types": "elided" + } } ], [ { - "PrimitiveType": { - "Uint": "U32" + "TupleType": { + "types": "elided" } } ], [ { - "StructType": { - "name": "std::panic::Location" + "TupleType": { + "types": "elided" } } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } ] ] } diff --git a/tests/integration/programs/char-trivial.smir.json.expected b/tests/integration/programs/char-trivial.smir.json.expected index 0ab827f..d339a69 100644 --- a/tests/integration/programs/char-trivial.smir.json.expected +++ b/tests/integration/programs/char-trivial.smir.json.expected @@ -1659,6 +1659,18 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": "Char" + } + ], [ { "EnumType": { @@ -1685,21 +1697,113 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": "Char" + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" } ] ] diff --git a/tests/integration/programs/closure-args.smir.json.expected b/tests/integration/programs/closure-args.smir.json.expected index 5d4833e..4b780e9 100644 --- a/tests/integration/programs/closure-args.smir.json.expected +++ b/tests/integration/programs/closure-args.smir.json.expected @@ -1950,6 +1950,18 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], [ { "EnumType": { @@ -1976,21 +1988,147 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": "Bool" + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" } ] ] diff --git a/tests/integration/programs/closure-no-args.smir.json.expected b/tests/integration/programs/closure-no-args.smir.json.expected index ecf642e..856828a 100644 --- a/tests/integration/programs/closure-no-args.smir.json.expected +++ b/tests/integration/programs/closure-no-args.smir.json.expected @@ -1770,6 +1770,20 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": { + "Uint": "U32" + } + } + ], [ { "EnumType": { @@ -1796,24 +1810,134 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": { - "Uint": "U32" + "TupleType": { + "types": "elided" } } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } ] ] } diff --git a/tests/integration/programs/const-arithm-simple.smir.json.expected b/tests/integration/programs/const-arithm-simple.smir.json.expected index ab683b9..6527f49 100644 --- a/tests/integration/programs/const-arithm-simple.smir.json.expected +++ b/tests/integration/programs/const-arithm-simple.smir.json.expected @@ -1913,6 +1913,25 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], + [ + { + "PrimitiveType": { + "Uint": "Usize" + } + } + ], [ { "EnumType": { @@ -1939,28 +1958,118 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": "Bool" + "TupleType": { + "types": "elided" + } } ], [ { - "PrimitiveType": { - "Uint": "Usize" - } + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" } ] ] diff --git a/tests/integration/programs/div.smir.json.expected b/tests/integration/programs/div.smir.json.expected index bc87f83..4103634 100644 --- a/tests/integration/programs/div.smir.json.expected +++ b/tests/integration/programs/div.smir.json.expected @@ -2026,6 +2026,18 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], [ { "EnumType": { @@ -2052,21 +2064,113 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": "Bool" + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" } ] ] diff --git a/tests/integration/programs/double-ref-deref.smir.json.expected b/tests/integration/programs/double-ref-deref.smir.json.expected index 8dac820..832a941 100644 --- a/tests/integration/programs/double-ref-deref.smir.json.expected +++ b/tests/integration/programs/double-ref-deref.smir.json.expected @@ -1777,6 +1777,13 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], [ { "EnumType": { @@ -1803,17 +1810,124 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } + ], + [ + { + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } ] ] } diff --git a/tests/integration/programs/enum.smir.json.expected b/tests/integration/programs/enum.smir.json.expected index c0b1b15..3b5ab65 100644 --- a/tests/integration/programs/enum.smir.json.expected +++ b/tests/integration/programs/enum.smir.json.expected @@ -1481,6 +1481,13 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], [ { "EnumType": { @@ -1500,15 +1507,25 @@ ], [ { - "StructType": { - "name": "std::sys::pal::unix::process::process_common::ExitCode" + "EnumType": { + "discriminants": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "name": "Letter" } } ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::sys::pal::unix::process::process_common::ExitCode" } } ], @@ -1521,20 +1538,97 @@ ], [ { - "EnumType": { - "discriminants": [ - [ - 0, - 0 - ], - [ - 1, - 1 - ] - ], - "name": "Letter" + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "TupleType": { + "types": "elided" } } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } ] ] } diff --git a/tests/integration/programs/fibonacci.smir.json.expected b/tests/integration/programs/fibonacci.smir.json.expected index 9da8fcc..8ed6171 100644 --- a/tests/integration/programs/fibonacci.smir.json.expected +++ b/tests/integration/programs/fibonacci.smir.json.expected @@ -2331,6 +2331,25 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], + [ + { + "PrimitiveType": { + "Uint": "U32" + } + } + ], [ { "EnumType": { @@ -2357,29 +2376,126 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": "Bool" + "TupleType": { + "types": "elided" + } } ], [ { - "PrimitiveType": { - "Uint": "U32" + "TupleType": { + "types": "elided" } } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } ] ] } diff --git a/tests/integration/programs/float.smir.json.expected b/tests/integration/programs/float.smir.json.expected index 7bd5b62..58c1afd 100644 --- a/tests/integration/programs/float.smir.json.expected +++ b/tests/integration/programs/float.smir.json.expected @@ -2229,6 +2229,37 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": { + "Float": "F32" + } + } + ], + [ + { + "PrimitiveType": { + "Float": "F64" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], + [ + { + "PrimitiveType": "Str" + } + ], [ { "EnumType": { @@ -2255,35 +2286,118 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": { - "Float": "F32" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": { - "Float": "F64" - } + "PtrType": "elided" } ], [ { - "PrimitiveType": "Bool" + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" } ] ] diff --git a/tests/integration/programs/modulo.smir.json.expected b/tests/integration/programs/modulo.smir.json.expected index b48f453..c4b3407 100644 --- a/tests/integration/programs/modulo.smir.json.expected +++ b/tests/integration/programs/modulo.smir.json.expected @@ -2024,6 +2024,18 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], [ { "EnumType": { @@ -2050,21 +2062,113 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": "Bool" + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" } ] ] diff --git a/tests/integration/programs/mutual_recursion.smir.json.expected b/tests/integration/programs/mutual_recursion.smir.json.expected index 601f62e..494949d 100644 --- a/tests/integration/programs/mutual_recursion.smir.json.expected +++ b/tests/integration/programs/mutual_recursion.smir.json.expected @@ -2282,6 +2282,25 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], + [ + { + "PrimitiveType": { + "Uint": "U32" + } + } + ], [ { "EnumType": { @@ -2308,29 +2327,131 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": "Bool" + "TupleType": { + "types": "elided" + } } ], [ { - "PrimitiveType": { - "Uint": "U32" + "TupleType": { + "types": "elided" } } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } ] ] } diff --git a/tests/integration/programs/option-construction.smir.json.expected b/tests/integration/programs/option-construction.smir.json.expected index f8ea1ed..b759e9f 100644 --- a/tests/integration/programs/option-construction.smir.json.expected +++ b/tests/integration/programs/option-construction.smir.json.expected @@ -1815,6 +1815,20 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": { + "Uint": "U32" + } + } + ], [ { "EnumType": { @@ -1834,15 +1848,25 @@ ], [ { - "StructType": { - "name": "std::sys::pal::unix::process::process_common::ExitCode" + "EnumType": { + "discriminants": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "name": "std::option::Option" } } ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::sys::pal::unix::process::process_common::ExitCode" } } ], @@ -1855,27 +1879,107 @@ ], [ { - "PrimitiveType": { - "Uint": "U32" + "TupleType": { + "types": "elided" } } ], [ { - "EnumType": { - "discriminants": [ - [ - 0, - 0 - ], - [ - 1, - 1 - ] - ], - "name": "std::option::Option" + "TupleType": { + "types": "elided" } } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } ] ] } diff --git a/tests/integration/programs/primitive-type-bounds.smir.json.expected b/tests/integration/programs/primitive-type-bounds.smir.json.expected index 8d320ca..860eeef 100644 --- a/tests/integration/programs/primitive-type-bounds.smir.json.expected +++ b/tests/integration/programs/primitive-type-bounds.smir.json.expected @@ -1889,6 +1889,25 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], + [ + { + "PrimitiveType": { + "Uint": "U32" + } + } + ], [ { "EnumType": { @@ -1915,29 +1934,121 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": "Bool" + "TupleType": { + "types": "elided" + } } ], [ { - "PrimitiveType": { - "Uint": "U32" + "TupleType": { + "types": "elided" } } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } ] ] } diff --git a/tests/integration/programs/recursion-simple-match.smir.json.expected b/tests/integration/programs/recursion-simple-match.smir.json.expected index ab1c1db..332bed7 100644 --- a/tests/integration/programs/recursion-simple-match.smir.json.expected +++ b/tests/integration/programs/recursion-simple-match.smir.json.expected @@ -2091,6 +2091,25 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], + [ + { + "PrimitiveType": { + "Uint": "U32" + } + } + ], [ { "EnumType": { @@ -2117,29 +2136,126 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": "Bool" + "TupleType": { + "types": "elided" + } } ], [ { - "PrimitiveType": { - "Uint": "U32" + "TupleType": { + "types": "elided" } } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } ] ] } diff --git a/tests/integration/programs/recursion-simple.smir.json.expected b/tests/integration/programs/recursion-simple.smir.json.expected index 02b0f69..4395124 100644 --- a/tests/integration/programs/recursion-simple.smir.json.expected +++ b/tests/integration/programs/recursion-simple.smir.json.expected @@ -2091,6 +2091,25 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": { + "Uint": "U32" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], [ { "EnumType": { @@ -2117,28 +2136,125 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": { - "Uint": "U32" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": "Bool" + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" } ] ] diff --git a/tests/integration/programs/ref-deref.smir.json.expected b/tests/integration/programs/ref-deref.smir.json.expected index df74828..6505bb2 100644 --- a/tests/integration/programs/ref-deref.smir.json.expected +++ b/tests/integration/programs/ref-deref.smir.json.expected @@ -1723,6 +1723,13 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], [ { "EnumType": { @@ -1749,17 +1756,119 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "TupleType": { + "types": "elided" } } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } ] ] } diff --git a/tests/integration/programs/shl_min.smir.json.expected b/tests/integration/programs/shl_min.smir.json.expected index ce1bc97..db40bbf 100644 --- a/tests/integration/programs/shl_min.smir.json.expected +++ b/tests/integration/programs/shl_min.smir.json.expected @@ -3503,6 +3503,51 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": { + "Uint": "U32" + } + } + ], + [ + { + "PrimitiveType": { + "Int": "I16" + } + } + ], + [ + { + "PrimitiveType": { + "Int": "I64" + } + } + ], + [ + { + "PrimitiveType": { + "Int": "I128" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], + [ + { + "PrimitiveType": "Str" + } + ], [ { "EnumType": { @@ -3529,56 +3574,130 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { "StructType": { - "name": "std::process::ExitCode" + "name": "std::panic::Location" } } ], [ { - "PrimitiveType": { - "Uint": "U32" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": { - "Int": "I16" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": { - "Int": "I64" - } + "PtrType": "elided" } ], [ { - "PrimitiveType": { - "Int": "I128" - } + "PtrType": "elided" } ], [ { - "PrimitiveType": "Bool" + "RefType": "elided" } ], [ { - "StructType": { - "name": "std::panic::Location" - } + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" } ] ] diff --git a/tests/integration/programs/slice.smir.json.expected b/tests/integration/programs/slice.smir.json.expected index 34f57d5..abe25b1 100644 --- a/tests/integration/programs/slice.smir.json.expected +++ b/tests/integration/programs/slice.smir.json.expected @@ -4493,8 +4493,34 @@ ], [ { - "StructType": { - "name": "std::ops::Range" + "PrimitiveType": "Bool" + } + ], + [ + { + "PrimitiveType": { + "Int": "I8" + } + } + ], + [ + { + "PrimitiveType": { + "Int": "Isize" + } + } + ], + [ + { + "PrimitiveType": { + "Uint": "U8" + } + } + ], + [ + { + "PrimitiveType": { + "Int": "I32" } } ], @@ -4517,27 +4543,35 @@ ], [ { - "PrimitiveType": "Bool" - } - ], - [ - { - "PrimitiveType": { - "Int": "I8" - } - } - ], - [ - { - "PrimitiveType": { - "Int": "Isize" + "EnumType": { + "discriminants": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "name": "std::result::Result" } } ], [ { - "PrimitiveType": { - "Uint": "U8" + "EnumType": { + "discriminants": [ + [ + 0, + 0 + ], + [ + 1, + 1 + ] + ], + "name": "std::option::Option" } } ], @@ -4561,14 +4595,14 @@ [ { "StructType": { - "name": "std::sys::pal::unix::process::process_common::ExitCode" + "name": "std::ops::Range" } } ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::sys::pal::unix::process::process_common::ExitCode" } } ], @@ -4588,37 +4622,256 @@ ], [ { - "EnumType": { - "discriminants": [ - [ - 0, - 0 - ], - [ - 1, - 1 - ] - ], - "name": "std::option::Option" + "ArrayType": [ + null + ] + } + ], + [ + { + "ArrayType": [ + { + "id": 1, + "kind": { + "Value": [ + 0, + { + "align": 8, + "bytes": [ + 4, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + ] + } + } + ] + } + ], + [ + { + "ArrayType": [ + { + "id": 0, + "kind": { + "Value": [ + 0, + { + "align": 8, + "bytes": [ + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "mutability": "Mut", + "provenance": { + "ptrs": [] + } + } + ] + } + } + ] + } + ], + [ + { + "TupleType": { + "types": "elided" } } ], [ { - "EnumType": { - "discriminants": [ - [ - 0, - 0 - ], - [ - 1, - 1 - ] - ], - "name": "std::result::Result" + "TupleType": { + "types": "elided" } } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } ] ] } diff --git a/tests/integration/programs/strange-ref-deref.smir.json.expected b/tests/integration/programs/strange-ref-deref.smir.json.expected index f536017..da147ce 100644 --- a/tests/integration/programs/strange-ref-deref.smir.json.expected +++ b/tests/integration/programs/strange-ref-deref.smir.json.expected @@ -1780,6 +1780,13 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], [ { "EnumType": { @@ -1806,17 +1813,124 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } + ], + [ + { + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } ] ] } diff --git a/tests/integration/programs/struct.smir.json.expected b/tests/integration/programs/struct.smir.json.expected index 4a77329..7ab4267 100644 --- a/tests/integration/programs/struct.smir.json.expected +++ b/tests/integration/programs/struct.smir.json.expected @@ -1925,6 +1925,25 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], + [ + { + "PrimitiveType": { + "Uint": "U32" + } + } + ], [ { "EnumType": { @@ -1951,36 +1970,128 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { "StructType": { - "name": "std::process::ExitCode" + "name": "St" } } ], [ { - "PrimitiveType": "Bool" + "TupleType": { + "types": "elided" + } } ], [ { - "PrimitiveType": { - "Uint": "U32" + "TupleType": { + "types": "elided" } } ], [ { - "StructType": { - "name": "St" + "TupleType": { + "types": "elided" } } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } ] ] } diff --git a/tests/integration/programs/sum-to-n.smir.json.expected b/tests/integration/programs/sum-to-n.smir.json.expected index 4c17167..146c358 100644 --- a/tests/integration/programs/sum-to-n.smir.json.expected +++ b/tests/integration/programs/sum-to-n.smir.json.expected @@ -2518,6 +2518,25 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": { + "Uint": "Usize" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], [ { "EnumType": { @@ -2544,28 +2563,130 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": { - "Uint": "Usize" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": "Bool" + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" } ] ] diff --git a/tests/integration/programs/tuple-eq.smir.json.expected b/tests/integration/programs/tuple-eq.smir.json.expected index 1b08099..64bf9ac 100644 --- a/tests/integration/programs/tuple-eq.smir.json.expected +++ b/tests/integration/programs/tuple-eq.smir.json.expected @@ -2475,6 +2475,18 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], [ { "EnumType": { @@ -2501,21 +2513,140 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": "Bool" + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" } ] ] diff --git a/tests/integration/programs/tuples-simple.smir.json.expected b/tests/integration/programs/tuples-simple.smir.json.expected index b7c8533..b2b013e 100644 --- a/tests/integration/programs/tuples-simple.smir.json.expected +++ b/tests/integration/programs/tuples-simple.smir.json.expected @@ -1771,6 +1771,18 @@ } } ], + [ + { + "PrimitiveType": { + "Int": "I32" + } + } + ], + [ + { + "PrimitiveType": "Bool" + } + ], [ { "EnumType": { @@ -1797,21 +1809,120 @@ ], [ { - "PrimitiveType": { - "Int": "I32" + "StructType": { + "name": "std::process::ExitCode" } } ], [ { - "StructType": { - "name": "std::process::ExitCode" + "TupleType": { + "types": "elided" } } ], [ { - "PrimitiveType": "Bool" + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "TupleType": { + "types": "elided" + } + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "PtrType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "RefType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" + } + ], + [ + { + "FunType": "elided" } ] ] diff --git a/tests/ui/run_ui_tests.sh b/tests/ui/run_ui_tests.sh index e37de87..6c7b28c 100755 --- a/tests/ui/run_ui_tests.sh +++ b/tests/ui/run_ui_tests.sh @@ -13,6 +13,8 @@ RUST_DIR_ROOT="$1" UI_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) PASSING_TSV="${UI_DIR}/passing.tsv" +KEEP_FILES=${KEEP_FILES:-""} + echo "Running regression tests for passing UI cases..." failed=0 @@ -30,7 +32,7 @@ while read -r test; do fi # Clean up generated JSON - [ -f "$json_file" ] && rm -f "$json_file" + [ -z "$KEEP_FILES" ] && [ -f "$json_file" ] && rm -f "$json_file" done < "$PASSING_TSV" if [ $failed -ne 0 ]; then