IRgen: Fix a horrible bug in pointer to bool conversion, which we were treating
as a truncation not a comparison to null.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112021 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/_Bool-conversion.c b/test/CodeGen/_Bool-conversion.c
new file mode 100644
index 0000000..fce7ada
--- /dev/null
+++ b/test/CodeGen/_Bool-conversion.c
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -triple i386 -emit-llvm -O2 -o - %s | FileCheck %s
+
+// CHECK: define i32 @f0()
+// CHECK: ret i32 1
+// CHECK: }
+
+static _Bool f0_0(void *a0) { return (_Bool) a0; }
+int f0() { return f0_0((void*) 0x2); }