OSDN Git Service

2009-01-14 Vladimir Makarov <vmakarov@redhat.com>
authorvmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Jan 2009 17:33:48 +0000 (17:33 +0000)
committervmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 14 Jan 2009 17:33:48 +0000 (17:33 +0000)
* testsuite/g++.dg/torture/pr38811.C: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143376 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/g++.dg/torture/pr38811.C [new file with mode: 0644]

index fba8a94..e5387ee 100644 (file)
@@ -1,3 +1,7 @@
+2009-01-14  Vladimir Makarov  <vmakarov@redhat.com>
+
+       * testsuite/g++.dg/torture/pr38811.C: New file.
+
 2009-01-14  Basile Starynkevitch  <basile@starynkevitch.net>
        * doc/gty.texi (Invoking the garbage collector): Added new node
        and section documenting ggc_collect.
diff --git a/gcc/testsuite/g++.dg/torture/pr38811.C b/gcc/testsuite/g++.dg/torture/pr38811.C
new file mode 100644 (file)
index 0000000..e9b304d
--- /dev/null
@@ -0,0 +1,73 @@
+/* { dg-do compile } */
+
+typedef unsigned long ULONG;
+void iwos_ErrorMessage(long error, const char * const file_name,
+                       ULONG line_num, const char * const message);
+class AbcA2d {
+public:
+    double x;
+    double y;
+    ~AbcA2d() { }
+};
+enum AbcZyParamType { ABC_SP_1 };
+class AbcExtent2d {
+    AbcA2d m_vMin;
+    AbcA2d m_vMax;
+public:
+    AbcExtent2d(const AbcA2d & rMin, const AbcA2d & rMax);
+    AbcA2d ClampPoint2d(const AbcA2d & rPoint) const;
+    AbcA2d GetMax() const { return m_vMax; }
+    AbcA2d GetMin() const { }
+    AbcA2d Evaluate(double dNormalizedX, double dNormalizedY) const;
+};
+inline AbcExtent2d::AbcExtent2d(const AbcA2d & rMin, const AbcA2d & rMax)
+{
+    if (rMin.x > rMax.x || rMin.y > rMax.y)
+      {
+        long sErr = (1007);
+        if (sErr != 1000)
+          iwos_ErrorMessage(sErr,(const char * const)__null,
+                            0,(const char * const)__null);
+      }
+    else
+      {
+        m_vMin = rMin;
+        m_vMax = rMax;
+      }
+}
+inline AbcA2d AbcExtent2d::ClampPoint2d(const AbcA2d & rPoint) const
+{
+    AbcA2d sRet = rPoint;
+    if (rPoint.x < m_vMin.x)
+      sRet.x = m_vMin.x;
+    return sRet;
+}
+inline AbcA2d AbcExtent2d::Evaluate(double dNormalizedX, double dNormalizedY)
+const
+{
+    AbcA2d sRet;
+    sRet.x = m_vMin.x + dNormalizedX * (m_vMax.x - m_vMin.x);
+    sRet.y = m_vMin.y + dNormalizedY * (m_vMax.y - m_vMin.y);
+    return ClampPoint2d(sRet);
+}
+class AbcAbcdTracer {
+    AbcExtent2d m_vUVDomain;
+    virtual long TestIsoAbcde(AbcZyParamType eZyParam, double dParam,
+                              int & rbZyxIsSolution);
+    virtual int DoesPointLieOnAbcde(AbcA2d & rUV, int bRefinePoint) const;
+};
+long AbcAbcdTracer::TestIsoAbcde(AbcZyParamType eZyParam, double dParam,
+                                 int & rbZyxIsSolution)
+{
+    AbcA2d sUV1(m_vUVDomain.GetMin());
+    AbcA2d sUV2(m_vUVDomain.GetMax());
+    AbcExtent2d sUVIso(sUV1,sUV2);
+    for (ULONG i=0; i<10; i++)
+      {
+        double dT = i / (10 -1.0);
+        AbcA2d sUV = sUVIso.Evaluate(dT,dT);
+        if (!DoesPointLieOnAbcde(sUV,0))
+          ;
+      }
+}
+