diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-21 18:32:21 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-21 18:32:21 +0000 |
commit | 0b78710636671eeb2c5c4dedffa4ad1d58fa4bb8 (patch) | |
tree | 317f5b93d6d46194ffb7c4bda86721e3443bd7da /test/CodeGenCXX/gnu-conditional-scalar-ext.cpp | |
parent | 8254aa62d9189395be1eed61194cd4b5ee6cb4a2 (diff) |
IRgen for gnu extension's conditional lvalue expression
with missing LHS. radar 8453812. Executable test is checked
into llvm test suite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/gnu-conditional-scalar-ext.cpp')
-rw-r--r-- | test/CodeGenCXX/gnu-conditional-scalar-ext.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/CodeGenCXX/gnu-conditional-scalar-ext.cpp b/test/CodeGenCXX/gnu-conditional-scalar-ext.cpp index a3f9fd2190..25eafc7e1b 100644 --- a/test/CodeGenCXX/gnu-conditional-scalar-ext.cpp +++ b/test/CodeGenCXX/gnu-conditional-scalar-ext.cpp @@ -39,8 +39,25 @@ _Complex int cmplx() { return getComplex(1+2i) ? : rhs; } +// lvalue test +void foo (int& lv) { + ++lv; +} + +int global = 1; + +int &cond() { + static int count; + if (count++) + abort(); + return global; +} + + int main() { cmplx(); - return 0; + int rhs = 10; + foo (cond()? : rhs); + return global-2; } } |