1b8a62b91Sopenharmony_ci#[test]
2b8a62b91Sopenharmony_cifn test_timespec_layout() {
3b8a62b91Sopenharmony_ci    #[cfg(not(target_os = "redox"))]
4b8a62b91Sopenharmony_ci    use rustix::fs::{UTIME_NOW, UTIME_OMIT};
5b8a62b91Sopenharmony_ci    use rustix::time::{Nsecs, Secs, Timespec};
6b8a62b91Sopenharmony_ci
7b8a62b91Sopenharmony_ci    let tv_sec: Secs = 0;
8b8a62b91Sopenharmony_ci    let tv_nsec: Nsecs = 0;
9b8a62b91Sopenharmony_ci    let x = Timespec { tv_sec, tv_nsec };
10b8a62b91Sopenharmony_ci
11b8a62b91Sopenharmony_ci    // Test that `Timespec` implements `Copy` and `Debug`.
12b8a62b91Sopenharmony_ci    let _y = Timespec { tv_sec, tv_nsec };
13b8a62b91Sopenharmony_ci    let _z = Timespec { tv_sec, tv_nsec };
14b8a62b91Sopenharmony_ci    dbg!(&x);
15b8a62b91Sopenharmony_ci
16b8a62b91Sopenharmony_ci    #[cfg(not(target_os = "redox"))]
17b8a62b91Sopenharmony_ci    let _ = Timespec {
18b8a62b91Sopenharmony_ci        tv_sec,
19b8a62b91Sopenharmony_ci        tv_nsec: UTIME_NOW,
20b8a62b91Sopenharmony_ci    };
21b8a62b91Sopenharmony_ci    #[cfg(not(target_os = "redox"))]
22b8a62b91Sopenharmony_ci    let _ = Timespec {
23b8a62b91Sopenharmony_ci        tv_sec,
24b8a62b91Sopenharmony_ci        tv_nsec: UTIME_OMIT,
25b8a62b91Sopenharmony_ci    };
26b8a62b91Sopenharmony_ci    let _ = Timespec { tv_sec, tv_nsec: 0 };
27b8a62b91Sopenharmony_ci    let _ = Timespec {
28b8a62b91Sopenharmony_ci        tv_sec,
29b8a62b91Sopenharmony_ci        tv_nsec: 999_999_999,
30b8a62b91Sopenharmony_ci    };
31b8a62b91Sopenharmony_ci}
32