forked from M-Labs/nac3
tests: fix missing target init
This commit is contained in:
@@ -158,8 +158,8 @@ impl TargetMachineOptions {
|
||||
#[must_use]
|
||||
pub fn create_target_machine(&self) -> TargetMachine {
|
||||
let triple = TargetTriple::create(self.triple.as_str());
|
||||
let target = Target::from_triple(&triple).unwrap_or_else(|_| {
|
||||
panic!("could not create target from target triple {}", self.triple)
|
||||
let target = Target::from_triple(&triple).unwrap_or_else(|e| {
|
||||
panic!("could not create target from target triple {}: {e}", self.triple)
|
||||
});
|
||||
|
||||
target
|
||||
|
||||
@@ -92,6 +92,7 @@ impl SymbolResolver for Resolver {
|
||||
}
|
||||
|
||||
fn codegen_options() -> CodeGenOptions {
|
||||
Target::initialize_native(&InitializationConfig::default()).unwrap();
|
||||
// We want things like debug assertions, but we otherwise want to run on optimized code.
|
||||
CodeGenOptions {
|
||||
opt_level: String::from("2"),
|
||||
@@ -199,8 +200,6 @@ fn test_primitives() {
|
||||
);
|
||||
})));
|
||||
|
||||
Target::initialize_all(&InitializationConfig::default());
|
||||
|
||||
let (registry, handles) =
|
||||
WorkerRegistry::create_workers(threads, top_level, &codegen_options(), &f);
|
||||
registry.add_task(task);
|
||||
@@ -349,8 +348,6 @@ fn test_simple_call() {
|
||||
);
|
||||
})));
|
||||
|
||||
Target::initialize_all(&InitializationConfig::default());
|
||||
|
||||
let (registry, handles) =
|
||||
WorkerRegistry::create_workers(threads, top_level, &codegen_options(), &f);
|
||||
registry.add_task(task);
|
||||
|
||||
Reference in New Issue
Block a user