v2 / vlib / v / tests / comptime / comptime_arch_test.v
28 lines · 27 sloc · 405 bytes · a11b69e2bcde42c1357de41caf8b81a1e8c5defe
Raw
1const arch = $if amd64 {
2 'amd64'
3} $else $if i386 {
4 'i386'
5}
6//$else $if aarch64 {'aarch64'}
7$else $if arm64 {
8 'arm64'
9} $else $if arm32 {
10 'arm32'
11} $else $if rv64 {
12 'rv64'
13} $else $if rv32 {
14 'rv32'
15} $else $if s390x {
16 's390x'
17} $else $if ppc64le {
18 'ppc64le'
19} $else $if loongarch64 {
20 'loongarch64'
21} $else {
22 'unknown'
23}
24
25fn test_main() {
26 println('arch is ${arch}')
27 assert arch != 'unknown'
28}
29