aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-1446.rs
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/rust/compile/issue-1446.rs')
-rw-r--r--gcc/testsuite/rust/compile/issue-1446.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/testsuite/rust/compile/issue-1446.rs b/gcc/testsuite/rust/compile/issue-1446.rs
index 8bfa42b..969ad38 100644
--- a/gcc/testsuite/rust/compile/issue-1446.rs
+++ b/gcc/testsuite/rust/compile/issue-1446.rs
@@ -1,3 +1,11 @@
+// fake function
+pub fn swap_bytes(this: u32) -> u32 {
+ (((this) & 0xff000000) >> 24)
+ | (((this) & 0x00ff0000) >> 8)
+ | (((this) & 0x0000ff00) << 8)
+ | (((this) & 0x000000ff) << 24)
+}
+
pub fn to_le(this: u32) -> u32 {
#[cfg(target_endian = "little")]
{
@@ -5,6 +13,6 @@ pub fn to_le(this: u32) -> u32 {
}
#[cfg(not(target_endian = "little"))]
{
- this.swap_bytes()
+ swap_bytes(this)
}
}