[gcc r14-7549] gccrs: Add test from issue 1446
Arthur Cohen
cohenarthur@gcc.gnu.org
Tue Jan 16 17:43:35 GMT 2024
https://gcc.gnu.org/g:a365e3ed705caf88509acc9237cfba1bffcea797
commit r14-7549-ga365e3ed705caf88509acc9237cfba1bffcea797
Author: Owen Avery <powerboat9.gamer@gmail.com>
Date: Tue May 2 20:21:42 2023 -0400
gccrs: Add test from issue 1446
gcc/testsuite/ChangeLog:
* rust/compile/issue-1446.rs: New test.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diff:
---
gcc/testsuite/rust/compile/issue-1446.rs | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/gcc/testsuite/rust/compile/issue-1446.rs b/gcc/testsuite/rust/compile/issue-1446.rs
new file mode 100644
index 00000000000..8bfa42b9dac
--- /dev/null
+++ b/gcc/testsuite/rust/compile/issue-1446.rs
@@ -0,0 +1,10 @@
+pub fn to_le(this: u32) -> u32 {
+ #[cfg(target_endian = "little")]
+ {
+ this
+ }
+ #[cfg(not(target_endian = "little"))]
+ {
+ this.swap_bytes()
+ }
+}
More information about the Gcc-cvs
mailing list