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 | e5433a90ceed96f8139a9ef27a4118a99af42ece (patch) | |
tree | 1491fd20bd463b64a0978b5d246f377d6c495cf6 /llvm/test | |
parent | fc80996a21ad3fb28f6dcc958a8ea579b3aaeef8 (diff) | |
download | bcm5719-llvm-e5433a90ceed96f8139a9ef27a4118a99af42ece.tar.gz bcm5719-llvm-e5433a90ceed96f8139a9ef27a4118a99af42ece.zip |
Test for PR1942.
llvm-svn: 46357
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/C++Frontend/2008-01-25-ResultIsParam.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/C++Frontend/2008-01-25-ResultIsParam.cpp b/llvm/test/C++Frontend/2008-01-25-ResultIsParam.cpp new file mode 100644 index 00000000000..eae402786b4 --- /dev/null +++ b/llvm/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; +} |