diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-17 04:24:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-17 04:24:20 +0000 |
commit | 671fec8727926eebea88265905e54cb82fafecc7 (patch) | |
tree | b2a9141a40953bf07b33d1e8b8db858feef6c3dc /clang/test | |
parent | 6e924a3090e54a52da133bbdb8add7b8ef528d3a (diff) | |
download | bcm5719-llvm-671fec8727926eebea88265905e54cb82fafecc7.tar.gz bcm5719-llvm-671fec8727926eebea88265905e54cb82fafecc7.zip |
Fix PR5211: codegen shouldn't assume that the result of ||/&& is int
anymore. In C++ it is bool.
llvm-svn: 84308
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGenCXX/expr.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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] ); +} |