[llvm] 0721d7c - [X86] Add test for PR54369 (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 31 07:45:13 PDT 2022
Author: Nikita Popov
Date: 2022-03-31T16:45:05+02:00
New Revision: 0721d7c4d8988d2ae0222b6e69b3504079dfd9c2
URL: https://github.com/llvm/llvm-project/commit/0721d7c4d8988d2ae0222b6e69b3504079dfd9c2
DIFF: https://github.com/llvm/llvm-project/commit/0721d7c4d8988d2ae0222b6e69b3504079dfd9c2.diff
LOG: [X86] Add test for PR54369 (NFC)
Added:
llvm/test/CodeGen/X86/pr54369.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/pr54369.ll b/llvm/test/CodeGen/X86/pr54369.ll
new file mode 100644
index 0000000000000..818b4f9d87ea3
--- /dev/null
+++ b/llvm/test/CodeGen/X86/pr54369.ll
@@ -0,0 +1,21 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc -mtriple=x86_64-- -O0 < %s | FileCheck %s
+
+; FIXME: This is currently miscompiled due to an eflags clobber.
+define i64 @adder(i64 %lhs, i64 %rhs) {
+; CHECK-LABEL: adder:
+; CHECK: # %bb.0:
+; CHECK-NEXT: addq %rsi, %rdi
+; CHECK-NEXT: seto %al
+; CHECK-NEXT: xorl %eax, %eax
+; CHECK-NEXT: # kill: def $rax killed $eax
+; CHECK-NEXT: movl $148, %ecx
+; CHECK-NEXT: cmovoq %rcx, %rax
+; CHECK-NEXT: retq
+ %res = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %lhs, i64 %rhs)
+ %errorbit = extractvalue { i64, i1 } %res, 1
+ %errorval = select i1 %errorbit, i64 148, i64 0
+ ret i64 %errorval
+}
+
+declare { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %a, i64 %b)
More information about the llvm-commits
mailing list