xref: /llvm-project/llvm/test/CodeGen/X86/setcc-narrowing.ll (revision 2f448bf509432c1a19ec46ab8cbc7353c03c6280)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=i686-apple-darwin | FileCheck %s
3; PR17338
4
5@t1.global = internal global i64 -1, align 8
6
7define i32 @t1() nounwind ssp {
8; CHECK-LABEL: t1:
9; CHECK:       ## %bb.0: ## %entry
10; CHECK-NEXT:    xorl %eax, %eax
11; CHECK-NEXT:    cmpl $0, _t1.global
12; CHECK-NEXT:    setne %al
13; CHECK-NEXT:    retl
14entry:
15  %0 = load i64, ptr @t1.global, align 8
16  %and = and i64 4294967295, %0
17  %cmp = icmp sgt i64 %and, 0
18  %conv = zext i1 %cmp to i32
19  ret i32 %conv
20}
21