about summary refs log tree commit diff
path: root/example
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-11-01 09:50:33 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2020-11-01 09:50:33 +0100
commitf4e8af268be3042643f581ded2e4c92bf95f66f3 (patch)
tree67c4c619f775639081bba20c9f966ccacef790cd /example
parent6b1902a0fa7e68c097157d6bb4c64c672fbb596b (diff)
downloadrust-f4e8af268be3042643f581ded2e4c92bf95f66f3.tar.gz
rust-f4e8af268be3042643f581ded2e4c92bf95f66f3.zip
Update Cranelift
Fixes bootstrapping of rustc using cg_clif

Fixes #1097
Diffstat (limited to 'example')
-rw-r--r--example/mini_core.rs10
-rw-r--r--example/mini_core_hello_world.rs22
2 files changed, 32 insertions, 0 deletions
diff --git a/example/mini_core.rs b/example/mini_core.rs
index a972beedaa3..ce07fe83df1 100644
--- a/example/mini_core.rs
+++ b/example/mini_core.rs
@@ -48,6 +48,7 @@ unsafe impl Copy for u8 {}
 unsafe impl Copy for u16 {}
 unsafe impl Copy for u32 {}
 unsafe impl Copy for u64 {}
+unsafe impl Copy for u128 {}
 unsafe impl Copy for usize {}
 unsafe impl Copy for i8 {}
 unsafe impl Copy for i16 {}
@@ -283,6 +284,15 @@ impl PartialEq for u64 {
     }
 }
 
+impl PartialEq for u128 {
+    fn eq(&self, other: &u128) -> bool {
+        (*self) == (*other)
+    }
+    fn ne(&self, other: &u128) -> bool {
+        (*self) != (*other)
+    }
+}
+
 impl PartialEq for usize {
     fn eq(&self, other: &usize) -> bool {
         (*self) == (*other)
diff --git a/example/mini_core_hello_world.rs b/example/mini_core_hello_world.rs
index 376056e1938..4a8375afac3 100644
--- a/example/mini_core_hello_world.rs
+++ b/example/mini_core_hello_world.rs
@@ -287,6 +287,8 @@ fn main() {
     assert_eq!(repeat[0], Some(42));
     assert_eq!(repeat[1], Some(42));
 
+    from_decimal_string();
+
     #[cfg(not(jit))]
     test_tls();
 
@@ -446,3 +448,23 @@ fn check_niche_behavior () {
         intrinsics::abort();
     }
 }
+
+fn from_decimal_string() {
+    loop {
+        let multiplier = 1;
+
+        take_multiplier_ref(&multiplier);
+
+        if multiplier == 1 {
+            break;
+        }
+
+        unreachable();
+    }
+}
+
+fn take_multiplier_ref(_multiplier: &u128) {}
+
+fn unreachable() -> ! {
+    panic("unreachable")
+}