@@ -55,6 +55,17 @@ fn main() {
5555 assert strict_run.exit_code == 0 , strict_run.output
5656 assert strict_run.output.trim_space () == '42'
5757
58+ debug_binary := os.join_path (root, 'debug' )
59+ debug_compile := cmdexec.run (v3_ bin, ['-silent' , '-g' , '-b' , 'fastc' , '-o' , debug_binary,
60+ valid_source])
61+ assert debug_compile.exit_code == 0 , debug_compile.output
62+ debug_c := os.read_file (debug_binary + '.c' ) or { panic (err) }
63+ assert ! debug_c.contains ('__typeof__((twice(21))) value = (twice(21));' )
64+ assert ! debug_c.contains ('V_FASTC_PRINT_SELECT' )
65+ debug_run := cmdexec.run (debug_binary, [])
66+ assert debug_run.exit_code == 0 , debug_run.output
67+ assert debug_run.output.trim_space () == '42'
68+
5869 invalid_source := os.join_path (root, 'invalid.v' )
5970 os.write_file (invalid_source, 'module main
6071
@@ -298,6 +309,26 @@ fn main() {
298309 assert high_hex_run.exit_code == 0 , high_hex_run.output
299310 assert high_hex_run.output.trim_space () == '-1'
300311
312+ high_binary_source := os.join_path (root, 'inferred_high_binary.v' )
313+ os.write_file (high_binary_source, 'module main
314+
315+ fn main() {
316+ x := 0b11111111111111111111111111111111 | 0
317+ println(x)
318+ }
319+ ' ) or {
320+ panic (err)
321+ }
322+ high_binary_binary := os.join_path (root, 'inferred_high_binary' )
323+ high_binary_compile := cmdexec.run (v3_ bin, ['-silent' , '-b' , 'fastc' , '-o' , high_binary_binary,
324+ high_binary_source])
325+ assert high_binary_compile.exit_code == 0 , high_binary_compile.output
326+ high_binary_c := os.read_file (high_binary_binary + '.c' ) or { panic (err) }
327+ assert ! high_binary_c.contains ('V_FASTC_PRINT_SELECT' )
328+ high_binary_run := cmdexec.run (high_binary_binary, [])
329+ assert high_binary_run.exit_code == 0 , high_binary_run.output
330+ assert high_binary_run.output.trim_space () == '-1'
331+
301332 parallel_assign_source := os.join_path (root, 'parallel_assign.v' )
302333 os.write_file (parallel_assign_source, 'module main
303334
0 commit comments