xref: /llvm-project/llvm/test/CodeGen/X86/pr55271.ll (revision 768a1ca5eccb678947f4155e38a5f5744dcefb56)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
3
4; abs(undef) should fold to 0 not undef.
5
6declare i32 @llvm.abs.i32(i32, i1 immarg) #0
7
8define i32 @abs(i32 %0) {
9; CHECK-LABEL: abs:
10; CHECK:       # %bb.0:
11; CHECK-NEXT:    xorl %eax, %eax
12; CHECK-NEXT:    retq
13  %2 = call i32 @llvm.abs.i32(i32 undef, i1 false)
14  ret i32 %2
15}
16