From: spop Date: Thu, 11 Feb 2010 19:43:05 +0000 (+0000) Subject: Add testcase for PR42930. X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=650845009eca25f34da463dfd749c5818cf1c05c;ds=sidebyside Add testcase for PR42930. 2010-02-10 Sebastian Pop * g++.dg/graphite/pr42930.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156715 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index 93e14fb0217..b047c2b6e5b 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,5 +1,13 @@ 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 * graphite-scop-detection.c (graphite_can_represent_scev): Call graphite_can_represent_init for MULT_EXPR. 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); + } +} +}