2017-01-07 17:38:43 +00:00
|
|
|
#
|
2017-01-07 18:53:57 +00:00
|
|
|
/* External variables to defeat constant folding. */
|
|
|
|
zero 0;
|
|
|
|
one 1;
|
|
|
|
|
2017-01-07 17:38:43 +00:00
|
|
|
i 0;
|
|
|
|
|
|
|
|
ext_t()
|
|
|
|
{
|
2017-01-07 18:53:57 +00:00
|
|
|
extrn zero, one, i;
|
2017-01-07 17:38:43 +00:00
|
|
|
|
2017-01-07 18:53:57 +00:00
|
|
|
i = zero;
|
2017-01-07 17:38:43 +00:00
|
|
|
if (!(i++ == 0)) fail(__LINE__);
|
|
|
|
|
2017-01-07 18:53:57 +00:00
|
|
|
i = one;
|
2017-01-07 17:38:43 +00:00
|
|
|
if (!(i-- == 1)) fail(__LINE__);
|
|
|
|
if (!(i == 0)) fail(__LINE__);
|
|
|
|
|
2017-01-07 18:53:57 +00:00
|
|
|
i = zero;
|
2017-01-07 17:38:43 +00:00
|
|
|
if (!(++i == 1)) fail(__LINE__);
|
|
|
|
if (!(i == 1)) fail(__LINE__);
|
|
|
|
|
2017-01-07 18:53:57 +00:00
|
|
|
i = one;
|
2017-01-07 17:38:43 +00:00
|
|
|
if (!(--i == 0)) fail(__LINE__);
|
|
|
|
if (!(i == 0)) fail(__LINE__);
|
|
|
|
}
|
|
|
|
|
|
|
|
int_t()
|
|
|
|
{
|
2017-01-07 18:53:57 +00:00
|
|
|
extrn zero, one;
|
|
|
|
auto i;
|
2017-01-07 17:38:43 +00:00
|
|
|
|
2017-01-07 18:53:57 +00:00
|
|
|
i = zero;
|
2017-01-07 17:38:43 +00:00
|
|
|
if (!(i++ == 0)) fail(__LINE__);
|
|
|
|
|
2017-01-07 18:53:57 +00:00
|
|
|
i = one;
|
2017-01-07 17:38:43 +00:00
|
|
|
if (!(i-- == 1)) fail(__LINE__);
|
|
|
|
if (!(i == 0)) fail(__LINE__);
|
|
|
|
|
2017-01-07 18:53:57 +00:00
|
|
|
i = zero;
|
2017-01-07 17:38:43 +00:00
|
|
|
if (!(++i == 1)) fail(__LINE__);
|
|
|
|
if (!(i == 1)) fail(__LINE__);
|
|
|
|
|
2017-01-07 18:53:57 +00:00
|
|
|
i = one;
|
2017-01-07 17:38:43 +00:00
|
|
|
if (!(--i == 0)) fail(__LINE__);
|
|
|
|
if (!(i == 0)) fail(__LINE__);
|
|
|
|
}
|
|
|
|
|
|
|
|
star_t()
|
|
|
|
{
|
2017-01-07 18:53:57 +00:00
|
|
|
extrn zero, one, i;
|
2017-01-07 17:38:43 +00:00
|
|
|
auto p;
|
|
|
|
|
|
|
|
p = &i;
|
|
|
|
|
2017-01-07 18:53:57 +00:00
|
|
|
i = zero;
|
2017-01-07 17:38:43 +00:00
|
|
|
if (!((*p)++ == 0)) fail(__LINE__);
|
|
|
|
|
2017-01-07 18:53:57 +00:00
|
|
|
i = one;
|
2017-01-07 17:38:43 +00:00
|
|
|
if (!((*p)-- == 1)) fail(__LINE__);
|
|
|
|
if (!(i == 0)) fail(__LINE__);
|
|
|
|
|
2017-01-07 18:53:57 +00:00
|
|
|
i = zero;
|
2017-01-07 17:38:43 +00:00
|
|
|
if (!(++(*p) == 1)) fail(__LINE__);
|
|
|
|
if (!(i == 1)) fail(__LINE__);
|
|
|
|
|
2017-01-07 18:53:57 +00:00
|
|
|
i = one;
|
2017-01-07 17:38:43 +00:00
|
|
|
if (!(--(*p) == 0)) fail(__LINE__);
|
|
|
|
if (!(i == 0)) fail(__LINE__);
|
|
|
|
}
|
|
|
|
|
|
|
|
main()
|
|
|
|
{
|
|
|
|
ext_t();
|
|
|
|
int_t();
|
|
|
|
star_t();
|
|
|
|
|
|
|
|
finished();
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|