From ced29554f757a702115a646dee163d48d1704d39 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Fri, 25 Jan 2008 17:36:44 +0000 Subject: [PATCH] Test for PR1942. llvm-svn: 46357 --- test/C++Frontend/2008-01-25-ResultIsParam.cpp | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/C++Frontend/2008-01-25-ResultIsParam.cpp 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 00000000000..eae402786b4 --- /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; +}