mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-31 23:50:30 +08:00
Add testcase for PR42930.
2010-02-10 Sebastian Pop <sebastian.pop@amd.com> * g++.dg/graphite/pr42930.C: New. From-SVN: r156715
This commit is contained in:
parent
141ecc2425
commit
be1c3b28b2
@ -1,3 +1,11 @@
|
|||||||
|
2010-02-10 Sebastian Pop <sebastian.pop@amd.com>
|
||||||
|
|
||||||
|
* graphite.c (graphite_transform_loops): Re-enable dbg_cnt.
|
||||||
|
|
||||||
|
2010-02-10 Sebastian Pop <sebastian.pop@amd.com>
|
||||||
|
|
||||||
|
* g++.dg/graphite/pr42930.C: New.
|
||||||
|
|
||||||
2010-02-10 Sebastian Pop <sebastian.pop@amd.com>
|
2010-02-10 Sebastian Pop <sebastian.pop@amd.com>
|
||||||
|
|
||||||
PR middle-end/42930
|
PR middle-end/42930
|
||||||
|
55
gcc/testsuite/g++.dg/graphite/pr42930.C
Normal file
55
gcc/testsuite/g++.dg/graphite/pr42930.C
Normal file
@ -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<class In, class Out>
|
||||||
|
Out copy(In first, In last, Out dst) {
|
||||||
|
while (first != last)
|
||||||
|
*dst++ = *first++;
|
||||||
|
}
|
||||||
|
template<class T>
|
||||||
|
class Array {
|
||||||
|
uint _size;
|
||||||
|
T *_storage;
|
||||||
|
public:
|
||||||
|
Array<T>& operator=(const Array<T> &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<Color> _colors;
|
||||||
|
};
|
||||||
|
class FWRenderer : public Common::NonCopyable {
|
||||||
|
Cine::Palette _activePal;
|
||||||
|
void drawCommand();
|
||||||
|
};
|
||||||
|
void FWRenderer::drawCommand() {
|
||||||
|
if (!_activePal.isValid() || _activePal.empty()) {
|
||||||
|
_activePal = Cine::Palette(kLowPalFormat, 16);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user