diff options
author | Duncan Sands <baldrick@free.fr> | 2008-01-25 17:36:44 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-01-25 17:36:44 +0000 |
commit | a699574651be2c9be71fbfa2ddbd787d390bb8a0 (patch) | |
tree | 2688eccdd6488645df8d9a7f321345f7238bb4f4 /test/C++Frontend | |
parent | 5bab78527a946632cd9614daa0b9a82ee7b5e1cc (diff) | |
download | external_llvm-a699574651be2c9be71fbfa2ddbd787d390bb8a0.zip external_llvm-a699574651be2c9be71fbfa2ddbd787d390bb8a0.tar.gz external_llvm-a699574651be2c9be71fbfa2ddbd787d390bb8a0.tar.bz2 |
Test for PR1942.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46357 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/C++Frontend')
-rw-r--r-- | test/C++Frontend/2008-01-25-ResultIsParam.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/C++Frontend/2008-01-25-ResultIsParam.cpp b/test/C++Frontend/2008-01-25-ResultIsParam.cpp new file mode 100644 index 0000000..eae4027 --- /dev/null +++ b/test/C++Frontend/2008-01-25-ResultIsParam.cpp @@ -0,0 +1,23 @@ +// RUN: %llvmgcc %s -S -o - | not grep {@_ZN3fooC1Ev.*result} +// PR1942 + +class foo +{ +public: + int a; + int b; + + foo(void) : a(0), b(0) {} + + foo(int aa, int bb) : a(aa), b(bb) {} + + const foo operator+(const foo& in) const; + +}; + +const foo foo::operator+(const foo& in) const { + foo Out; + Out.a = a + in.a; + Out.b = b + in.b; + return Out; +} |