0 branches
Tree
Top files
Clone with HTTPS:
.gitignore
v2: ease the testing with different C compilers, using `CVERBOSE=1 CC=tcc CFLAGS=-I/usr/local/lib/tcc/include ./v2 -backend cleanc hello.v`
last Jan 30
4 bytes
test_ssa_backends.v
v2: move all generics logic to transformer; fixes to compile the 3d game engine Viper (#27304)
last Jun 3
6.79 KB
test_sumtype.v
v2: lots of arm64/ssa fixes; make array_test and string_test pass with arm64
last Feb 28
275 bytes
test_sumtype2.v
v2: lots of arm64/ssa fixes; make array_test and string_test pass with arm64
last Feb 28
610 bytes
test_sumtype3.v
v2: lots of arm64/ssa fixes; make array_test and string_test pass with arm64
last Feb 28
573 bytes
test_sumtype4.v
v2: lots of arm64/ssa fixes; make array_test and string_test pass with arm64
last Feb 28
401 bytes
test_sumtype_data.v
v2: lots of arm64/ssa fixes; make array_test and string_test pass with arm64
last Feb 28
408 bytes
test_sumtype_global.v
v2: lots of arm64/ssa fixes; make array_test and string_test pass with arm64
last Feb 28
1001 bytes
test_sumtype_ifexpr.v
v2: lots of arm64/ssa fixes; make array_test and string_test pass with arm64
last Feb 28
596 bytes
test_sumtype_nested.v
v2: lots of arm64 fixes: v2 compiled with arm64 can now compile hello world!; v2.eval; v2.cleanc fixes to compile viper engine
last Mar 10
1.68 KB
Run all ARM64 tests
./v run vlib/v2/gen/arm64/tests/run_tests.v
# Run specific test with test_ssa_backends
cd cmd/v2
./test_ssa_backends arm64 ../../vlib/v2/gen/arm64/tests/string_concat.v
# Or directly with v2
./v2 -backend arm64 ../../vlib/v2/gen/arm64/tests/string_concat.v
Useful cleanc flags
# Disable builtin+strconv object cache for this build:
./v2 -backend cleanc -nocache file.v
# Print C compiler and link command(s):
./v2 -backend cleanc -showcc file.v
# Print extended parse/build stats:
./v2 -stats -backend cleanc file.v
# Includes per-pass C Gen timing lines to help locate slow codegen phases.
# Print every parsed file (full and .vh groups):
./v2 -print-parsed-files -backend cleanc file.v
# Disable markused pruning (emit all functions):
./v2 -nomarkused -backend cleanc file.v
Eval backend
# Execute a small V program directly from the v2 AST:
./v2 -eval file.v
# Pass runtime args to the interpreted program:
./v2 -eval file.v -- arg1 arg2
# Self-host under eval without recursively reusing the outer compiler flags:
./v2 -eval cmd/v2/v2.v -- -o /tmp/v2self cmd/v2/v2.v
# Current scope: literals, locals/consts, plain fn calls, if/for/range,
# arrays, indexing, len, println/print, and basic string interpolation.
SSA C backend (restored)
# Run the SSA -> C backend directly:
./v2 -backend c cmd/v2/test.v
# Compare SSA C output against reference V output:
cd cmd/v2
../../v run test_ssa_backends.v c