From 671fec8727926eebea88265905e54cb82fafecc7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 17 Oct 2009 04:24:20 +0000 Subject: Fix PR5211: codegen shouldn't assume that the result of ||/&& is int anymore. In C++ it is bool. llvm-svn: 84308 --- clang/test/CodeGenCXX/expr.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'clang/test/CodeGenCXX/expr.cpp') diff --git a/clang/test/CodeGenCXX/expr.cpp b/clang/test/CodeGenCXX/expr.cpp index ae5b0e644f2..4dc97c47aa2 100644 --- a/clang/test/CodeGenCXX/expr.cpp +++ b/clang/test/CodeGenCXX/expr.cpp @@ -1,5 +1,12 @@ // RUN: clang-cc -emit-llvm -x c++ < %s -void f(int x) { +void test0(int x) { if (x != 0) return; } + + +// PR5211 +void test1() { + char *xpto; + while ( true && xpto[0] ); +} -- cgit v1.2.3