// { dg-do assemble }
|
// { dg-do assemble }
|
// { dg-options "-O2 -g" }
|
// { dg-options "-O2 -g" }
|
// (Should preferrably cycle through options.)
|
// (Should preferrably cycle through options.)
|
// Origin: Hans-Peter Nilsson
|
// Origin: Hans-Peter Nilsson
|
// See
|
// See
|
|
|
typedef unsigned int udword;
|
typedef unsigned int udword;
|
extern "C" {
|
extern "C" {
|
void __assert (const char *, int, const char *);
|
void __assert (const char *, int, const char *);
|
}
|
}
|
class ShZzy;
|
class ShZzy;
|
class ShBe;
|
class ShBe;
|
class Sh
|
class Sh
|
{
|
{
|
public:
|
public:
|
class Xy;
|
class Xy;
|
inline Sh(const char* theName,
|
inline Sh(const char* theName,
|
const Xy& theXys);
|
const Xy& theXys);
|
virtual ~Sh();
|
virtual ~Sh();
|
inline const char* name() const;
|
inline const char* name() const;
|
inline bool shXy(const Xy& theXy);
|
inline bool shXy(const Xy& theXy);
|
virtual void setParent(Sh* theParent);
|
virtual void setParent(Sh* theParent);
|
class Xy
|
class Xy
|
{
|
{
|
public:
|
public:
|
Xy(int theXy);
|
Xy(int theXy);
|
Xy(const Xy& theXy);
|
Xy(const Xy& theXy);
|
Xy& operator = (const Xy&);
|
Xy& operator = (const Xy&);
|
bool sh(const Xy& theXy);
|
bool sh(const Xy& theXy);
|
private:
|
private:
|
int myXyFlags;
|
int myXyFlags;
|
};
|
};
|
protected:
|
protected:
|
Xy myXys;
|
Xy myXys;
|
private:
|
private:
|
Sh();
|
Sh();
|
Sh(const Sh&);
|
Sh(const Sh&);
|
Sh& operator = (const Sh&);
|
Sh& operator = (const Sh&);
|
const char* myName;
|
const char* myName;
|
Sh* myParent;
|
Sh* myParent;
|
};
|
};
|
class ShZzy : public Sh
|
class ShZzy : public Sh
|
{
|
{
|
public:
|
public:
|
inline ShZzy(const char* theName);
|
inline ShZzy(const char* theName);
|
inline ShZzy(const char* theName,
|
inline ShZzy(const char* theName,
|
const Xy& theXys);
|
const Xy& theXys);
|
virtual ~ShZzy();
|
virtual ~ShZzy();
|
void addShTo(char* theParent);
|
void addShTo(char* theParent);
|
virtual void ap() {}
|
virtual void ap() {}
|
void addSh(Sh* theSh);
|
void addSh(Sh* theSh);
|
virtual void setParent(Sh* theParent);
|
virtual void setParent(Sh* theParent);
|
void baseAp();
|
void baseAp();
|
private:
|
private:
|
ShZzy();
|
ShZzy();
|
ShZzy(const ShZzy&);
|
ShZzy(const ShZzy&);
|
ShZzy& operator = (const ShZzy&);
|
ShZzy& operator = (const ShZzy&);
|
bool iAmInited;
|
bool iAmInited;
|
};
|
};
|
class ShBop
|
class ShBop
|
{
|
{
|
public:
|
public:
|
inline ShBop(const ShBe* theBe);
|
inline ShBop(const ShBe* theBe);
|
void shWw(bool,
|
void shWw(bool,
|
const char* a1 = "",
|
const char* a1 = "",
|
const char* a2 = "",
|
const char* a2 = "",
|
int a3 = -1,
|
int a3 = -1,
|
const char* a4 = "foo");
|
const char* a4 = "foo");
|
typedef enum { shOk,
|
typedef enum { shOk,
|
shFailed,
|
shFailed,
|
shDone,
|
shDone,
|
invalidBop } bopType;
|
invalidBop } bopType;
|
inline bopType bop();
|
inline bopType bop();
|
inline int numberOfVs();
|
inline int numberOfVs();
|
inline void closeBop();
|
inline void closeBop();
|
private:
|
private:
|
ShBop(const ShBop&);
|
ShBop(const ShBop&);
|
ShBop& operator = (const ShBop&);
|
ShBop& operator = (const ShBop&);
|
const ShBe* myBe;
|
const ShBe* myBe;
|
bopType myBop;
|
bopType myBop;
|
int my1;
|
int my1;
|
int my2;
|
int my2;
|
const char* my3;
|
const char* my3;
|
const char* my4;
|
const char* my4;
|
int my5;
|
int my5;
|
const char* my6;
|
const char* my6;
|
};
|
};
|
Sh::Sh(const char* theName,
|
Sh::Sh(const char* theName,
|
const Xy& theXys)
|
const Xy& theXys)
|
:myXys(theXys),
|
:myXys(theXys),
|
myName(theName),
|
myName(theName),
|
myParent(0)
|
myParent(0)
|
{}
|
{}
|
const char*
|
const char*
|
Sh::name() const
|
Sh::name() const
|
{
|
{
|
return myName;
|
return myName;
|
}
|
}
|
bool
|
bool
|
Sh::shXy(const Xy& theXy)
|
Sh::shXy(const Xy& theXy)
|
{
|
{
|
return myXys.sh(theXy);
|
return myXys.sh(theXy);
|
}
|
}
|
ShZzy::ShZzy(const char* theName)
|
ShZzy::ShZzy(const char* theName)
|
:Sh(theName, Xy(0)),
|
:Sh(theName, Xy(0)),
|
iAmInited(false)
|
iAmInited(false)
|
{}
|
{}
|
ShZzy::ShZzy(const char* theName,
|
ShZzy::ShZzy(const char* theName,
|
const Xy& theXys)
|
const Xy& theXys)
|
:Sh(theName, theXys),
|
:Sh(theName, theXys),
|
iAmInited(false)
|
iAmInited(false)
|
{}
|
{}
|
ShBop::ShBop(const ShBe* theBe)
|
ShBop::ShBop(const ShBe* theBe)
|
:myBe(theBe),
|
:myBe(theBe),
|
myBop(invalidBop),
|
myBop(invalidBop),
|
my1(0),
|
my1(0),
|
my2(0),
|
my2(0),
|
my3(""),
|
my3(""),
|
my4(""),
|
my4(""),
|
my5(0),
|
my5(0),
|
my6("")
|
my6("")
|
{}
|
{}
|
ShBop::bopType
|
ShBop::bopType
|
ShBop::bop()
|
ShBop::bop()
|
{
|
{
|
((!my2 || myBop == shFailed) ? (void)0 : __assert("foo", 91,"foo"));
|
((!my2 || myBop == shFailed) ? (void)0 : __assert("foo", 91,"foo"));
|
return myBop;
|
return myBop;
|
}
|
}
|
int
|
int
|
ShBop::numberOfVs()
|
ShBop::numberOfVs()
|
{
|
{
|
return my2 + my1;
|
return my2 + my1;
|
}
|
}
|
void
|
void
|
ShBop::closeBop()
|
ShBop::closeBop()
|
{
|
{
|
if (myBop == invalidBop)
|
if (myBop == invalidBop)
|
{
|
{
|
myBop = shDone;
|
myBop = shDone;
|
}
|
}
|
}
|
}
|
class ShBe;
|
class ShBe;
|
template
|
template
|
class ShAp : public ShZzy
|
class ShAp : public ShZzy
|
{
|
{
|
public:
|
public:
|
ShAp(const char* theName);
|
ShAp(const char* theName);
|
ShAp(const char* theName,
|
ShAp(const char* theName,
|
const Xy& theXys);
|
const Xy& theXys);
|
virtual ~ShAp() {}
|
virtual ~ShAp() {}
|
typedef void (ShCc::*ShMethod)();
|
typedef void (ShCc::*ShMethod)();
|
virtual void ap() {}
|
virtual void ap() {}
|
protected:
|
protected:
|
ShBop* bop();
|
ShBop* bop();
|
private:
|
private:
|
ShAp();
|
ShAp();
|
ShAp(const ShAp&);
|
ShAp(const ShAp&);
|
ShAp& operator = (const ShAp&);
|
ShAp& operator = (const ShAp&);
|
ShBop* myBop;
|
ShBop* myBop;
|
ShBe* myBe;
|
ShBe* myBe;
|
};
|
};
|
class ShBe : public Sh
|
class ShBe : public Sh
|
{
|
{
|
public:
|
public:
|
inline ShBe(const char* theName);
|
inline ShBe(const char* theName);
|
inline ShBe(const char* theName,
|
inline ShBe(const char* theName,
|
const Xy& theXys);
|
const Xy& theXys);
|
inline virtual ~ShBe();
|
inline virtual ~ShBe();
|
virtual void run() = 0;
|
virtual void run() = 0;
|
ShBop* runBe();
|
ShBop* runBe();
|
protected:
|
protected:
|
inline ShBop* bop();
|
inline ShBop* bop();
|
private:
|
private:
|
ShBe();
|
ShBe();
|
ShBe(const ShBe&);
|
ShBe(const ShBe&);
|
ShBe& operator = (const ShBe&);
|
ShBe& operator = (const ShBe&);
|
ShBop* myBop;
|
ShBop* myBop;
|
};
|
};
|
template
|
template
|
ShAp::ShAp(const char* theName)
|
ShAp::ShAp(const char* theName)
|
: ShZzy(theName),
|
: ShZzy(theName),
|
myBop(0),
|
myBop(0),
|
myBe(0)
|
myBe(0)
|
{}
|
{}
|
template
|
template
|
ShAp::ShAp(const char* theName,
|
ShAp::ShAp(const char* theName,
|
const Sh::Xy& theXys)
|
const Sh::Xy& theXys)
|
: ShZzy(theName, theXys),
|
: ShZzy(theName, theXys),
|
myBop(0),
|
myBop(0),
|
myBe(0)
|
myBe(0)
|
{}
|
{}
|
template
|
template
|
ShBop*
|
ShBop*
|
ShAp::bop()
|
ShAp::bop()
|
{
|
{
|
((myBop) ? (void)0 : __assert("foo", 96,"foo"));
|
((myBop) ? (void)0 : __assert("foo", 96,"foo"));
|
return myBop;
|
return myBop;
|
}
|
}
|
class xSh : public ShAp
|
class xSh : public ShAp
|
{
|
{
|
public:
|
public:
|
xSh();
|
xSh();
|
virtual ~xSh();
|
virtual ~xSh();
|
void ap();
|
void ap();
|
void uff();
|
void uff();
|
void rtt();
|
void rtt();
|
};
|
};
|
class xUff
|
class xUff
|
{
|
{
|
public:
|
public:
|
xUff();
|
xUff();
|
xUff(const xUff&);
|
xUff(const xUff&);
|
xUff& operator = (const xUff&);
|
xUff& operator = (const xUff&);
|
xUff(udword);
|
xUff(udword);
|
operator udword() const;
|
operator udword() const;
|
xUff& operator = (udword);
|
xUff& operator = (udword);
|
bool operator < (const xUff) const;
|
bool operator < (const xUff) const;
|
bool operator <= (const xUff) const;
|
bool operator <= (const xUff) const;
|
bool operator > (const xUff) const;
|
bool operator > (const xUff) const;
|
bool operator >= (const xUff) const;
|
bool operator >= (const xUff) const;
|
bool operator == (const xUff) const;
|
bool operator == (const xUff) const;
|
enum {size = 4};
|
enum {size = 4};
|
xUff(unsigned char* theUff);
|
xUff(unsigned char* theUff);
|
private:
|
private:
|
udword myUff;
|
udword myUff;
|
};
|
};
|
inline
|
inline
|
xUff::xUff()
|
xUff::xUff()
|
: myUff(0)
|
: myUff(0)
|
{
|
{
|
}
|
}
|
inline
|
inline
|
xUff::xUff(udword theUff)
|
xUff::xUff(udword theUff)
|
: myUff(theUff)
|
: myUff(theUff)
|
{
|
{
|
}
|
}
|
inline
|
inline
|
xUff::xUff(
|
xUff::xUff(
|
const xUff& theUff)
|
const xUff& theUff)
|
: myUff(theUff.myUff)
|
: myUff(theUff.myUff)
|
{
|
{
|
}
|
}
|
inline xUff&
|
inline xUff&
|
xUff::operator = (const xUff& theUff)
|
xUff::operator = (const xUff& theUff)
|
{
|
{
|
myUff = theUff.myUff;
|
myUff = theUff.myUff;
|
return *this;
|
return *this;
|
}
|
}
|
inline xUff&
|
inline xUff&
|
xUff::operator = (udword theUff)
|
xUff::operator = (udword theUff)
|
{
|
{
|
myUff = theUff;
|
myUff = theUff;
|
return *this;
|
return *this;
|
}
|
}
|
inline
|
inline
|
xUff::operator udword() const
|
xUff::operator udword() const
|
{
|
{
|
return myUff;
|
return myUff;
|
}
|
}
|
inline bool
|
inline bool
|
xUff::operator < (const xUff ding) const
|
xUff::operator < (const xUff ding) const
|
{
|
{
|
return (((int) (myUff - ding.myUff)) < 0);
|
return (((int) (myUff - ding.myUff)) < 0);
|
}
|
}
|
inline bool
|
inline bool
|
xUff::operator <= (const xUff ding) const
|
xUff::operator <= (const xUff ding) const
|
{
|
{
|
return (((int) (myUff - ding.myUff)) <= 0);
|
return (((int) (myUff - ding.myUff)) <= 0);
|
}
|
}
|
inline bool
|
inline bool
|
xUff::operator > (const xUff ding) const
|
xUff::operator > (const xUff ding) const
|
{
|
{
|
return (((int) (myUff - ding.myUff)) > 0);
|
return (((int) (myUff - ding.myUff)) > 0);
|
}
|
}
|
inline bool
|
inline bool
|
xUff::operator >= (const xUff ding) const
|
xUff::operator >= (const xUff ding) const
|
{
|
{
|
return (((int) (myUff - ding.myUff)) >= 0);
|
return (((int) (myUff - ding.myUff)) >= 0);
|
}
|
}
|
inline bool
|
inline bool
|
xUff::operator == (const xUff ding) const
|
xUff::operator == (const xUff ding) const
|
{
|
{
|
return (myUff == ding.myUff);
|
return (myUff == ding.myUff);
|
}
|
}
|
inline
|
inline
|
xUff::xUff(unsigned char* theUff)
|
xUff::xUff(unsigned char* theUff)
|
{
|
{
|
myUff = *(udword *)theUff;
|
myUff = *(udword *)theUff;
|
}
|
}
|
void
|
void
|
xSh::uff()
|
xSh::uff()
|
{
|
{
|
static const udword halfudword = 0x80000000;
|
static const udword halfudword = 0x80000000;
|
xUff aGah((udword)0);
|
xUff aGah((udword)0);
|
udword diagonal = halfudword + (udword) aGah;
|
udword diagonal = halfudword + (udword) aGah;
|
xUff aGeh(diagonal - 1);
|
xUff aGeh(diagonal - 1);
|
xUff aGoh(diagonal + 1);
|
xUff aGoh(diagonal + 1);
|
(bop()->shWw ((aGah.operator <=(aGah)), ("foo"), ( ""), 118, "foo"));
|
(bop()->shWw ((aGah.operator <=(aGah)), ("foo"), ( ""), 118, "foo"));
|
(bop()->shWw ((aGah.operator >=(aGah)), ("foo"), ( ""), 119, "foo"));
|
(bop()->shWw ((aGah.operator >=(aGah)), ("foo"), ( ""), 119, "foo"));
|
(bop()->shWw ((!(aGah.operator <(aGah))), ("foo"), ( ""), 120, "foo"));
|
(bop()->shWw ((!(aGah.operator <(aGah))), ("foo"), ( ""), 120, "foo"));
|
(bop()->shWw ((!(aGah.operator >(aGah))), ("foo"), ( ""), 121, "foo"));
|
(bop()->shWw ((!(aGah.operator >(aGah))), ("foo"), ( ""), 121, "foo"));
|
(bop()->shWw ((aGah.operator <(aGeh)), ("foo"), ( ""), 124, "foo"));
|
(bop()->shWw ((aGah.operator <(aGeh)), ("foo"), ( ""), 124, "foo"));
|
(bop()->shWw ((aGah.operator <=(aGeh)), ("foo"), ( ""), 125, "foo"));
|
(bop()->shWw ((aGah.operator <=(aGeh)), ("foo"), ( ""), 125, "foo"));
|
(bop()->shWw ((!(aGah.operator >(aGeh))), ("foo"), ( ""), 126, "foo"));
|
(bop()->shWw ((!(aGah.operator >(aGeh))), ("foo"), ( ""), 126, "foo"));
|
(bop()->shWw ((!(aGah.operator >=(aGeh))), ("foo"), ( ""), 127, "foo"));
|
(bop()->shWw ((!(aGah.operator >=(aGeh))), ("foo"), ( ""), 127, "foo"));
|
(bop()->shWw ((aGeh.operator >(aGah)), ("foo"), ( ""), 130, "foo"));
|
(bop()->shWw ((aGeh.operator >(aGah)), ("foo"), ( ""), 130, "foo"));
|
(bop()->shWw ((aGeh.operator >=(aGah)), ("foo"), ( ""), 131, "foo"));
|
(bop()->shWw ((aGeh.operator >=(aGah)), ("foo"), ( ""), 131, "foo"));
|
(bop()->shWw ((!(aGeh.operator <(aGah))), ("foo"), ( ""), 132, "foo"));
|
(bop()->shWw ((!(aGeh.operator <(aGah))), ("foo"), ( ""), 132, "foo"));
|
(bop()->shWw ((!(aGeh.operator <=(aGah))), ("foo"), ( ""), 133, "foo"));
|
(bop()->shWw ((!(aGeh.operator <=(aGah))), ("foo"), ( ""), 133, "foo"));
|
(bop()->shWw ((aGeh.operator <(aGoh)), ("foo"), ( ""), 136, "foo"));
|
(bop()->shWw ((aGeh.operator <(aGoh)), ("foo"), ( ""), 136, "foo"));
|
(bop()->shWw ((aGeh.operator <=(aGoh)), ("foo"), ( ""), 137, "foo"));
|
(bop()->shWw ((aGeh.operator <=(aGoh)), ("foo"), ( ""), 137, "foo"));
|
(bop()->shWw ((!(aGeh.operator >(aGoh))), ("foo"), ( ""), 138, "foo"));
|
(bop()->shWw ((!(aGeh.operator >(aGoh))), ("foo"), ( ""), 138, "foo"));
|
(bop()->shWw ((!(aGeh.operator >=(aGoh))), ("foo"), ( ""), 139, "foo"));
|
(bop()->shWw ((!(aGeh.operator >=(aGoh))), ("foo"), ( ""), 139, "foo"));
|
(bop()->shWw ((aGoh.operator >(aGeh)), ("foo"), ( ""), 142, "foo"));
|
(bop()->shWw ((aGoh.operator >(aGeh)), ("foo"), ( ""), 142, "foo"));
|
(bop()->shWw ((aGoh.operator >=(aGeh)), ("foo"), ( ""), 143, "foo"));
|
(bop()->shWw ((aGoh.operator >=(aGeh)), ("foo"), ( ""), 143, "foo"));
|
(bop()->shWw ((!(aGoh.operator <(aGeh))), ("foo"), ( ""), 144, "foo"));
|
(bop()->shWw ((!(aGoh.operator <(aGeh))), ("foo"), ( ""), 144, "foo"));
|
(bop()->shWw ((!(aGoh.operator <=(aGeh))), ("foo"), ( ""), 145, "foo"));
|
(bop()->shWw ((!(aGoh.operator <=(aGeh))), ("foo"), ( ""), 145, "foo"));
|
(bop()->shWw ((aGah.operator >(aGoh)), ("foo"), ( ""), 152, "foo"));
|
(bop()->shWw ((aGah.operator >(aGoh)), ("foo"), ( ""), 152, "foo"));
|
(bop()->shWw ((aGah.operator >=(aGoh)), ("foo"), ( ""), 153, "foo"));
|
(bop()->shWw ((aGah.operator >=(aGoh)), ("foo"), ( ""), 153, "foo"));
|
(bop()->shWw ((!(aGah.operator <(aGoh))), ("foo"), ( ""), 154, "foo"));
|
(bop()->shWw ((!(aGah.operator <(aGoh))), ("foo"), ( ""), 154, "foo"));
|
(bop()->shWw ((!(aGah.operator <=(aGoh))), ("foo"), ( ""), 155, "foo"));
|
(bop()->shWw ((!(aGah.operator <=(aGoh))), ("foo"), ( ""), 155, "foo"));
|
(bop()->shWw ((aGoh.operator <(aGah)), ("foo"), ( ""), 158, "foo"));
|
(bop()->shWw ((aGoh.operator <(aGah)), ("foo"), ( ""), 158, "foo"));
|
(bop()->shWw ((aGoh.operator <=(aGah)), ("foo"), ( ""), 159, "foo"));
|
(bop()->shWw ((aGoh.operator <=(aGah)), ("foo"), ( ""), 159, "foo"));
|
(bop()->shWw ((!(aGoh.operator >(aGah))), ("foo"), ( ""), 160, "foo"));
|
(bop()->shWw ((!(aGoh.operator >(aGah))), ("foo"), ( ""), 160, "foo"));
|
(bop()->shWw ((!(aGoh.operator >=(aGah))), ("foo"), ( ""), 161, "foo"));
|
(bop()->shWw ((!(aGoh.operator >=(aGah))), ("foo"), ( ""), 161, "foo"));
|
}
|
}
|
|
|