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)]
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             anyhow::bail!("Expected incompatibility between the `table_lazy_init` option and Winch")
16         }
17         Err(e) => {
18             assert_eq!(
19                 e.to_string(),
20                 "Winch requires the table-lazy-init option to be enabled"
21             );
22         }
23     }
24 
25     Ok(())
26 }
27 
28 #[wasmtime_test(strategies(only(Winch)))]
29 #[cfg_attr(miri, ignore)]
30 fn ensure_compatibility_between_winch_and_signals_based_traps(config: &mut Config) -> Result<()> {
31     config.signals_based_traps(false);
32     let result = Engine::new(&config);
33     match result {
34         Ok(_) => {
35             anyhow::bail!(
36                 "Expected incompatibility between the `signals_based_traps` option and Winch"
37             )
38         }
39         Err(e) => {
40             assert_eq!(
41                 e.to_string(),
42                 "Winch requires the signals-based-traps option to be enabled"
43             );
44         }
45     }
46 
47     Ok(())
48 }
49 
50 #[wasmtime_test(strategies(only(Winch)))]
51 #[cfg_attr(miri, ignore)]
52 fn ensure_compatibility_between_winch_and_debug_native(config: &mut Config) -> Result<()> {
53     config.debug_info(true);
54     let result = Engine::new(&config);
55     match result {
56         Ok(_) => {
57             anyhow::bail!("Expected incompatibility between the `debug_native` option and Winch")
58         }
59         Err(e) => {
60             assert_eq!(
61                 e.to_string(),
62                 "Winch does not currently support generating native debug information"
63             );
64         }
65     }
66 
67     Ok(())
68 }
69