diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-13 21:09:41 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-13 21:09:41 +0000 |
commit | ad25883a644dd6b52c7923dd128a7d05fb26213c (patch) | |
tree | 20af1f5012931dcbb928e97f8277f6bb6196a940 /test/CodeGenCXX/copy-assign-synthesis.cpp | |
parent | 65010da986b2b13fa04c736855ac68183596420e (diff) |
Patch to force synthesis of copy assignment operator
function in the order according to c++03. ir-gen
for copy assignment in the trivial case and the first
test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78938 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/copy-assign-synthesis.cpp')
-rw-r--r-- | test/CodeGenCXX/copy-assign-synthesis.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/CodeGenCXX/copy-assign-synthesis.cpp b/test/CodeGenCXX/copy-assign-synthesis.cpp new file mode 100644 index 0000000000..0677ac9bbb --- /dev/null +++ b/test/CodeGenCXX/copy-assign-synthesis.cpp @@ -0,0 +1,28 @@ +// RUN: clang-cc -emit-llvm -o %t %s && +// RUN: grep "_ZN1XaSERK1X" %t | count 0 + +extern "C" int printf(...); + +struct X { + X() : d(0.0), d1(1.1), d2(1.2), d3(1.3) {} + double d; + double d1; + double d2; + double d3; + void pr() { + printf("d = %f d1 = %f d2 = %f d3 = %f\n", d, d1,d2,d3); + } +}; + + +X srcX; +X dstX; +X dstY; + +int main() { + dstY = dstX = srcX; + srcX.pr(); + dstX.pr(); + dstY.pr(); +} + |