about summary refs log tree commit diff
path: root/tests/codegen-llvm/bigint-helpers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codegen-llvm/bigint-helpers.rs')
-rw-r--r--tests/codegen-llvm/bigint-helpers.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/codegen-llvm/bigint-helpers.rs b/tests/codegen-llvm/bigint-helpers.rs
new file mode 100644
index 00000000000..355cccb8150
--- /dev/null
+++ b/tests/codegen-llvm/bigint-helpers.rs
@@ -0,0 +1,13 @@
+//@ compile-flags: -C opt-level=3
+
+#![crate_type = "lib"]
+#![feature(bigint_helper_methods)]
+
+// CHECK-LABEL: @u32_carrying_add
+#[no_mangle]
+pub fn u32_carrying_add(a: u32, b: u32, c: bool) -> (u32, bool) {
+    // CHECK: @llvm.uadd.with.overflow.i32
+    // CHECK: @llvm.uadd.with.overflow.i32
+    // CHECK: or disjoint i1
+    u32::carrying_add(a, b, c)
+}