1
+ mod argument;
1
2
mod compile;
2
3
mod config;
3
4
mod intrinsic;
4
5
mod json_parser;
5
6
mod types;
6
7
7
- use std:: fs:: File ;
8
+ use std:: fs:: { self , File } ;
8
9
9
10
use rayon:: prelude:: * ;
10
11
@@ -72,6 +73,7 @@ impl SupportedArchitectureTest for ArmArchitectureTest {
72
73
let cpp_compiler_wrapped = compile:: build_cpp_compilation ( & self . cli_options ) ;
73
74
74
75
let notice = & build_notices ( "// " ) ;
76
+ fs:: create_dir_all ( "c_programs" ) . unwrap ( ) ;
75
77
self . intrinsics
76
78
. par_chunks ( chunk_size)
77
79
. enumerate ( )
@@ -81,7 +83,7 @@ impl SupportedArchitectureTest for ArmArchitectureTest {
81
83
write_mod_cpp ( & mut file, notice, c_target, platform_headers, chunk) . unwrap ( ) ;
82
84
83
85
// compile this cpp file into a .o file
84
- if let Some ( cpp_compiler) = cpp_compiler_wrapped. as_ref ( ) {
86
+ if let Some ( cpp_compiler) = cpp_compiler_wrapped. as_ref ( ) {
85
87
let output = cpp_compiler
86
88
. compile_object_file ( & format ! ( "mod_{i}.cpp" ) , & format ! ( "mod_{i}.o" ) ) ?;
87
89
assert ! ( output. status. success( ) , "{output:?}" ) ;
@@ -104,17 +106,17 @@ impl SupportedArchitectureTest for ArmArchitectureTest {
104
106
// This is done because `cpp_compiler_wrapped` is None when
105
107
// the --generate-only flag is passed
106
108
if let Some ( cpp_compiler) = cpp_compiler_wrapped. as_ref ( ) {
107
- // compile this cpp file into a .o file
109
+ // compile this cpp file into a .o file
108
110
info ! ( "compiling main.cpp" ) ;
109
111
let output = cpp_compiler
110
112
. compile_object_file ( "main.cpp" , "intrinsic-test-programs.o" )
111
113
. unwrap ( ) ;
112
114
assert ! ( output. status. success( ) , "{output:?}" ) ;
113
-
115
+
114
116
let object_files = ( 0 ..chunk_count)
115
117
. map ( |i| format ! ( "mod_{i}.o" ) )
116
118
. chain ( [ "intrinsic-test-programs.o" . to_owned ( ) ] ) ;
117
-
119
+
118
120
let output = cpp_compiler
119
121
. link_executable ( object_files, "intrinsic-test-programs" )
120
122
. unwrap ( ) ;
0 commit comments