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 | 7804bcba90bf5ea8ec6cd0f6cc9a64577f1a9259 (patch) | |
| tree | 2f1422eab96de57b901b1c7a8635d5aeb25871c0 /test/CodeGenCXX/expr.cpp | |
| parent | 5460d2b51965a53c5db537d432988f5e1d20af6f (diff) | |
| download | clang-7804bcba90bf5ea8ec6cd0f6cc9a64577f1a9259.tar.gz clang-7804bcba90bf5ea8ec6cd0f6cc9a64577f1a9259.tar.bz2 clang-7804bcba90bf5ea8ec6cd0f6cc9a64577f1a9259.tar.xz | |
Fix PR5211: codegen shouldn't assume that the result of ||/&& is int
anymore. In C++ it is bool.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84308 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/expr.cpp')
| -rw-r--r-- | test/CodeGenCXX/expr.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/CodeGenCXX/expr.cpp b/test/CodeGenCXX/expr.cpp index ae5b0e644f..4dc97c47aa 100644 --- a/test/CodeGenCXX/expr.cpp +++ b/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] ); +} |
