v2 / vlib / v / builder / gc_flags_test.v
24 lines · 22 sloc · 715 bytes · 9f76fd047dfac89e5b7328183dc7b75432de45d2
Raw
1module builder
2
3import os
4
5fn test_macos_tcc_boehm_uses_bundled_libgc() {
6 $if !macos {
7 return
8 }
9 $if arm64 {
10 // TCC on macOS arm64 cannot link the i386/asm path that this test exercises.
11 return
12 }
13 exe_path := os.join_path(os.vtmp_dir(), 'builder_gc_flags_test')
14 source_path := os.join_path(@VEXEROOT, 'examples', 'hello_world.v')
15 cmd := '${os.quoted_path(@VEXE)} -showcc -cc tcc -no-retry-compilation -o ${os.quoted_path(exe_path)} ${os.quoted_path(source_path)}'
16 res := os.execute(cmd)
17 defer {
18 os.rm(exe_path) or {}
19 }
20 assert res.exit_code == 0
21 // macOS amd64 tccbin only ships libgc.a (no .dylib).
22 assert res.output.contains('thirdparty/tcc/lib/libgc.a')
23 assert !res.output.contains(' -lgc')
24}
25