From be1c3b28b25c7086f5be41d003ff9cb321f057a6 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Thu, 11 Feb 2010 19:43:05 +0000 Subject: [PATCH] Add testcase for PR42930. 2010-02-10 Sebastian Pop * g++.dg/graphite/pr42930.C: New. From-SVN: r156715 --- gcc/ChangeLog.graphite | 8 ++++ gcc/testsuite/g++.dg/graphite/pr42930.C | 55 +++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 gcc/testsuite/g++.dg/graphite/pr42930.C diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index 93e14fb0217..b047c2b6e5b 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,3 +1,11 @@ +2010-02-10 Sebastian Pop + + * graphite.c (graphite_transform_loops): Re-enable dbg_cnt. + +2010-02-10 Sebastian Pop + + * g++.dg/graphite/pr42930.C: New. + 2010-02-10 Sebastian Pop PR middle-end/42930 diff --git a/gcc/testsuite/g++.dg/graphite/pr42930.C b/gcc/testsuite/g++.dg/graphite/pr42930.C new file mode 100644 index 00000000000..c1150ce9353 --- /dev/null +++ b/gcc/testsuite/g++.dg/graphite/pr42930.C @@ -0,0 +1,55 @@ +/* { dg-options "-O1 -floop-block" } */ + +typedef unsigned char byte; +typedef unsigned int uint; +typedef unsigned char uint8; +namespace Common { +class NonCopyable { +}; +template +Out copy(In first, In last, Out dst) { + while (first != last) + *dst++ = *first++; +} +template +class Array { + uint _size; + T *_storage; +public: + Array& operator=(const Array &array) { + copy(array._storage, array._storage + _size, _storage); + } +}; +} +namespace Graphics { +struct PixelFormat { + inline PixelFormat() { + } + inline PixelFormat(byte BytesPerPixel, + byte RBits, byte GBits, byte BBits, byte ABits, + byte RShift, byte GShift, byte BShift, byte AShift) { + } +}; +}; +namespace Cine { +static const Graphics::PixelFormat kLowPalFormat(2, 3, 3, 3, 0, 8, 4, 0, 0); +class Palette { +public: + struct Color { + uint8 r, g, b; + }; + Palette(const Graphics::PixelFormat format = Graphics::PixelFormat(), const uint numColors = 0); + bool empty() const; + bool isValid() const; + Common::Array _colors; +}; +class FWRenderer : public Common::NonCopyable { + Cine::Palette _activePal; + void drawCommand(); +}; +void FWRenderer::drawCommand() { + if (!_activePal.isValid() || _activePal.empty()) { + _activePal = Cine::Palette(kLowPalFormat, 16); + } +} +} -- 2.30.2