diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-04-23 04:16:32 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-04-23 04:16:32 +0000 |
commit | 6a03e345bb3c971750920e34a0d7d1ea7c9eceb7 (patch) | |
tree | 64109c598640fdb31d4803236622b57c48cb2be4 /test/CodeGenCXX/assign-operator.cpp | |
parent | 0e313bd4795c005f23c43f127039fd948c3e0bd9 (diff) |
Handle compound assignment expressions (i += j) as lvalues, which is
permitted in C++ but not in C. Fixes PR6900. Clang can now handle all
of Boost.Lambda's regression tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102170 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/assign-operator.cpp')
-rw-r--r-- | test/CodeGenCXX/assign-operator.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/CodeGenCXX/assign-operator.cpp b/test/CodeGenCXX/assign-operator.cpp index 805fe8df69..c4b64e6e51 100644 --- a/test/CodeGenCXX/assign-operator.cpp +++ b/test/CodeGenCXX/assign-operator.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -emit-llvm-only -verify +// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -emit-llvm -verify -o - |FileCheck %s class x { public: int operator=(int); @@ -7,3 +7,13 @@ void a() { x a; a = 1u; } + +void f(int i, int j) { + // CHECK: load i32 + // CHECK: load i32 + // CHECK: add nsw i32 + // CHECK: store i32 + // CHECK: store i32 17, i32 + // CHECK: ret + (i += j) = 17; +} |