mirror of
https://github.com/vlang/v.git
synced 2025-08-03 17:57:59 -04:00
parent
9b348b1b11
commit
a11b69e2bc
@ -5,7 +5,7 @@ pub const valid_comptime_if_os = ['windows', 'ios', 'macos', 'mach', 'darwin', '
|
||||
'haiku', 'serenity', 'vinix', 'plan9', 'wasm32_emscripten']
|
||||
pub const valid_comptime_if_compilers = ['gcc', 'tinyc', 'clang', 'mingw', 'msvc', 'cplusplus']
|
||||
pub const valid_comptime_if_platforms = ['amd64', 'i386', 'aarch64', 'arm64', 'arm32', 'rv64',
|
||||
'rv32', 's390x', 'ppc64le']
|
||||
'rv32', 's390x', 'ppc64le', 'loongarch64']
|
||||
pub const valid_comptime_if_cpu_features = ['x64', 'x32', 'little_endian', 'big_endian']
|
||||
pub const valid_comptime_if_other = ['apk', 'js', 'debug', 'prod', 'test', 'glibc', 'prealloc',
|
||||
'no_bounds_checking', 'freestanding', 'threads', 'js_node', 'js_browser', 'js_freestanding',
|
||||
|
28
vlib/v/tests/comptime/comptime_arch_test.v
Normal file
28
vlib/v/tests/comptime/comptime_arch_test.v
Normal file
@ -0,0 +1,28 @@
|
||||
const arch = $if amd64 {
|
||||
'amd64'
|
||||
} $else $if i386 {
|
||||
'i386'
|
||||
}
|
||||
//$else $if aarch64 {'aarch64'}
|
||||
$else $if arm64 {
|
||||
'arm64'
|
||||
} $else $if arm32 {
|
||||
'arm32'
|
||||
} $else $if rv64 {
|
||||
'rv64'
|
||||
} $else $if rv32 {
|
||||
'rv32'
|
||||
} $else $if s390x {
|
||||
's390x'
|
||||
} $else $if ppc64le {
|
||||
'ppc64le'
|
||||
} $else $if loongarch64 {
|
||||
'loongarch64'
|
||||
} $else {
|
||||
'unknown'
|
||||
}
|
||||
|
||||
fn test_main() {
|
||||
println('arch is ${arch}')
|
||||
assert arch != 'unknown'
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user