Commit c2d43326 by Andrew Pinski Committed by Andrew Pinski

nested-3.c: New testcase.

2017-04-02  Andrew Pinski  <apinski@cavium.com>

        * gcc.c-torture/compile/nested-3.c: New testcase.
        * gcc.c-torture/execute/20170401-1.c: New testcase.
        * gcc.c-torture/execute/20170401-2.c: New testcase.

From-SVN: r246639
parent 5ada68f2
2017-04-02 Andrew Pinski <apinski@cavium.com>
* gcc.c-torture/compile/nested-3.c: New testcase.
* gcc.c-torture/execute/20170401-1.c: New testcase.
* gcc.c-torture/execute/20170401-2.c: New testcase.
2017-03-31 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/79405
......
struct a
{
int t;
int t1;
};
int f(int i, int j)
{
struct a *t;
struct a t1 = {i, j};
t = &t1;
auto int g(void) __attribute__((noinline));
int g(void)
{
return t->t + t->t1;
}
return g();
}
/* PR45070 */
extern void abort(void);
struct packed_ushort {
unsigned short ucs;
} __attribute__((packed));
struct source {
int pos, length;
};
static int flag;
static void __attribute__((noinline)) fetch(struct source *p)
{
p->length = 128;
}
static struct packed_ushort __attribute__((noinline)) next(struct source *p)
{
struct packed_ushort rv;
if (p->pos >= p->length) {
if (flag) {
flag = 0;
fetch(p);
return next(p);
}
flag = 1;
rv.ucs = 0xffff;
return rv;
}
rv.ucs = 0;
return rv;
}
int main(void)
{
struct source s;
int i;
s.pos = 0;
s.length = 0;
flag = 0;
for (i = 0; i < 16; i++) {
struct packed_ushort rv = next(&s);
if ((i == 0 && rv.ucs != 0xffff)
|| (i > 0 && rv.ucs != 0))
abort();
}
return 0;
}
void adjust_xy (short *, short *);
struct adjust_template
{
short kx_x;
short kx_y;
};
static struct adjust_template adjust = {1, 1};
main ()
{
short x = 1, y = 1;
adjust_xy (&x, &y);
if (x != 2)
abort ();
exit (0);
}
void
adjust_xy (x, y)
short *x;
short *y;
{
*x = adjust.kx_x * *x + adjust.kx_y * *y;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment