@@ -9,6 +9,7 @@ const OS_TABLE: &'static [(&'static str, &'static str)] = &[
9
9
( "androideabi" , "android" ) ,
10
10
( "bitrig" , "bitrig" ) ,
11
11
( "cloudabi" , "cloudabi" ) ,
12
+ ( "cuda" , "cuda" ) ,
12
13
( "darwin" , "macos" ) ,
13
14
( "dragonfly" , "dragonfly" ) ,
14
15
( "emscripten" , "emscripten" ) ,
@@ -20,9 +21,11 @@ const OS_TABLE: &'static [(&'static str, &'static str)] = &[
20
21
( "l4re" , "l4re" ) ,
21
22
( "linux" , "linux" ) ,
22
23
( "mingw32" , "windows" ) ,
24
+ ( "none" , "none" ) ,
23
25
( "netbsd" , "netbsd" ) ,
24
26
( "openbsd" , "openbsd" ) ,
25
27
( "redox" , "redox" ) ,
28
+ ( "sgx" , "sgx" ) ,
26
29
( "solaris" , "solaris" ) ,
27
30
( "win32" , "windows" ) ,
28
31
( "windows" , "windows" ) ,
@@ -38,6 +41,7 @@ const ARCH_TABLE: &'static [(&'static str, &'static str)] = &[
38
41
( "armv7" , "arm" ) ,
39
42
( "armv7s" , "arm" ) ,
40
43
( "asmjs" , "asmjs" ) ,
44
+ ( "cuda" , "cuda" ) ,
41
45
( "hexagon" , "hexagon" ) ,
42
46
( "i386" , "x86" ) ,
43
47
( "i586" , "x86" ) ,
@@ -154,6 +158,7 @@ fn test_get_arch_failure() {
154
158
fn test_get_arch ( ) {
155
159
assert_eq ! ( "x86_64" , get_arch( "x86_64-unknown-linux-gnu" ) ) ;
156
160
assert_eq ! ( "x86_64" , get_arch( "amd64" ) ) ;
161
+ assert_eq ! ( "cuda" , get_arch( "nvptx64-nvidia-cuda" ) ) ;
157
162
}
158
163
159
164
#[ test]
@@ -168,4 +173,8 @@ fn test_matches_os() {
168
173
assert ! ( matches_os( "wasm32-unknown-unknown" , "emscripten" ) ) ;
169
174
assert ! ( matches_os( "wasm32-unknown-unknown" , "wasm32-bare" ) ) ;
170
175
assert ! ( !matches_os( "wasm32-unknown-unknown" , "windows" ) ) ;
176
+ assert ! ( matches_os( "thumbv6m0-none-eabi" , "none" ) ) ;
177
+ assert ! ( matches_os( "riscv32imc-unknown-none-elf" , "none" ) ) ;
178
+ assert ! ( matches_os( "nvptx64-nvidia-cuda" , "cuda" ) ) ;
179
+ assert ! ( matches_os( "x86_64-fortanix-unknown-sgx" , "sgx" ) ) ;
171
180
}
0 commit comments