about summary refs log tree commit diff
path: root/tests/codegen-llvm/merge-functions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/codegen-llvm/merge-functions.rs')
-rw-r--r--tests/codegen-llvm/merge-functions.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/codegen-llvm/merge-functions.rs b/tests/codegen-llvm/merge-functions.rs
new file mode 100644
index 00000000000..b9d3727ce11
--- /dev/null
+++ b/tests/codegen-llvm/merge-functions.rs
@@ -0,0 +1,16 @@
+//@ revisions: O Os
+//@[Os] compile-flags: -Copt-level=s
+//@[O] compile-flags: -Copt-level=3
+#![crate_type = "lib"]
+
+// CHECK: @func{{2|1}} = {{.*}}alias{{.*}}@func{{1|2}}
+
+#[no_mangle]
+pub fn func1(c: char) -> bool {
+    c == 's' || c == 'm' || c == 'h' || c == 'd' || c == 'w'
+}
+
+#[no_mangle]
+pub fn func2(c: char) -> bool {
+    matches!(c, 's' | 'm' | 'h' | 'd' | 'w')
+}