]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/X86/computeKnownBits_urem.ll
Vendor import of llvm trunk r291274:
[FreeBSD/FreeBSD.git] / test / CodeGen / X86 / computeKnownBits_urem.ll
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-linux | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mtriple=x86_64-linux | FileCheck %s --check-prefix=X64
4
5 define i32 @main() nounwind {
6 ; X86-LABEL: main:
7 ; X86:       # BB#0: # %entry
8 ; X86-NEXT:    pushl %eax
9 ; X86-NEXT:    movl $1, (%esp)
10 ; X86-NEXT:    movl $1, %eax
11 ; X86-NEXT:    popl %ecx
12 ; X86-NEXT:    retl
13 ;
14 ; X64-LABEL: main:
15 ; X64:       # BB#0: # %entry
16 ; X64-NEXT:    movl $1, -{{[0-9]+}}(%rsp)
17 ; X64-NEXT:    movl $1, %eax
18 ; X64-NEXT:    retq
19 entry:
20   %a = alloca i32, align 4
21   store i32 1, i32* %a, align 4
22   %0 = load i32, i32* %a, align 4
23   %or = or i32 1, %0
24   %and = and i32 1, %or
25   %rem = urem i32 %and, 1
26   %add = add i32 %rem, 1
27   ret i32 %add
28 }