MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / panic_on_define_after_finalize

Function panic_on_define_after_finalize

cranelift/object/tests/basic.rs:62–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60#[test]
61#[should_panic(expected = "Result::unwrap()` on an `Err` value: DuplicateDefinition(\"abc\")")]
62fn panic_on_define_after_finalize() {
63 let flag_builder = settings::builder();
64 let isa_builder = cranelift_codegen::isa::lookup_by_name("x86_64-unknown-linux-gnu").unwrap();
65 let isa = isa_builder
66 .finish(settings::Flags::new(flag_builder))
67 .unwrap();
68 let mut module =
69 ObjectModule::new(ObjectBuilder::new(isa, "foo", default_libcall_names()).unwrap());
70
71 define_simple_function(&mut module);
72 define_simple_function(&mut module);
73}
74
75#[test]
76#[cfg_attr(not(debug_assertions), ignore = "checks a debug assertion")]

Callers

nothing calls this directly

Calls 7

lookup_by_nameFunction · 0.85
default_libcall_namesFunction · 0.85
define_simple_functionFunction · 0.70
builderFunction · 0.50
newFunction · 0.50
unwrapMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected