1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
3 define zeroext i1 @f1(i8* %x) {
5 ; CHECK: movb (%rdi), %al
9 %0 = load i8, i8* %x, align 1, !range !0
10 %tobool = trunc i8 %0 to i1
14 define zeroext i1 @f2(i8* %x) {
16 ; CHECK: movb (%rdi), %al
20 %0 = load i8, i8* %x, align 1, !range !0
21 %tobool = icmp ne i8 %0, 0
28 ; check that we don't build a "trunc" from i1 to i1, which would assert.
29 define zeroext i1 @f3(i1 %x) {
33 %tobool = icmp ne i1 %x, 0
37 ; check that we don't build a trunc when other bits are needed
38 define zeroext i1 @f4(i32 %x) {
43 %y = and i32 %x, 32768
44 %z = icmp ne i32 %y, 0