1 // Skip entirely on unsupported architectures as different error messages will
2 // be reported.
3 #![cfg(target_arch = "x86_64")]
4 
5 use wasmtime::*;
6 use wasmtime_test_macros::wasmtime_test;
7 
8 #[wasmtime_test(strategies(only(Winch)))]
9 #[cfg_attr(miri, ignore)]
ensure_compatibility_between_winch_and_table_lazy_init(config: &mut Config) -> Result<()>10 fn ensure_compatibility_between_winch_and_table_lazy_init(config: &mut Config) -> Result<()> {
11     config.table_lazy_init(false);
12     let result = Engine::new(&config);
13     match result {
14         Ok(_) => {
15             wasmtime::bail!(
16                 "Expected incompatibility between the `table_lazy_init` option and Winch"
17             )
18         }
19         Err(e) => {
20             assert_eq!(
21                 e.to_string(),
22                 "Winch requires the table-lazy-init option to be enabled"
23             );
24         }
25     }
26 
27     Ok(())
28 }
29 
30 #[wasmtime_test(strategies(only(Winch)))]
31 #[cfg_attr(miri, ignore)]
ensure_compatibility_between_winch_and_signals_based_traps(config: &mut Config) -> Result<()>32 fn ensure_compatibility_between_winch_and_signals_based_traps(config: &mut Config) -> Result<()> {
33     config.signals_based_traps(false);
34     let result = Engine::new(&config);
35     match result {
36         Ok(_) => {
37             wasmtime::bail!(
38                 "Expected incompatibility between the `signals_based_traps` option and Winch"
39             )
40         }
41         Err(e) => {
42             assert_eq!(
43                 e.to_string(),
44                 "Winch requires the signals-based-traps option to be enabled"
45             );
46         }
47     }
48 
49     Ok(())
50 }
51 
52 #[wasmtime_test(strategies(only(Winch)))]
53 #[cfg_attr(miri, ignore)]
ensure_compatibility_between_winch_and_debug_native(config: &mut Config) -> Result<()>54 fn ensure_compatibility_between_winch_and_debug_native(config: &mut Config) -> Result<()> {
55     config.debug_info(true);
56     let result = Engine::new(&config);
57     match result {
58         Ok(_) => {
59             wasmtime::bail!("Expected incompatibility between the `debug_native` option and Winch")
60         }
61         Err(e) => {
62             assert_eq!(
63                 e.to_string(),
64                 "Winch does not currently support generating native debug information"
65             );
66         }
67     }
68 
69     Ok(())
70 }
71