aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2010-02-11 19:43:05 +0000
committerSebastian Pop <spop@gcc.gnu.org>2010-02-11 19:43:05 +0000
commitbe1c3b28b25c7086f5be41d003ff9cb321f057a6 (patch)
treea41e8cc20f8548b1c9b3e74f81953103deb931b4 /gcc
parent141ecc2425ef0345aef3fd1f8e8d740956ae6f4c (diff)
downloadgcc-be1c3b28b25c7086f5be41d003ff9cb321f057a6.zip
gcc-be1c3b28b25c7086f5be41d003ff9cb321f057a6.tar.gz
gcc-be1c3b28b25c7086f5be41d003ff9cb321f057a6.tar.bz2
Add testcase for PR42930.
2010-02-10 Sebastian Pop <sebastian.pop@amd.com> * g++.dg/graphite/pr42930.C: New. From-SVN: r156715
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog.graphite8
-rw-r--r--gcc/testsuite/g++.dg/graphite/pr42930.C55
2 files changed, 63 insertions, 0 deletions
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 93e14fb..b047c2b 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,13 @@
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>
+
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 0000000..c1150ce
--- /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<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);
+ }
+}
+}