Message ID | 20191009194315.GA4882@SDF.ORG |
---|---|
State | New |
Headers | show |
Series | [PR,target/85401,v2] Add test-cases | expand |
On Wed, 9 Oct 2019, coypu@sdf.org wrote: > diff --git a/gcc/testsuite/gcc.c-torture/compile/pr85401-2.c b/gcc/testsuite/gcc.c-torture/compile/pr85401-2.c > new file mode 100644 > index 0000000..1d68d0b > --- /dev/null > +++ b/gcc/testsuite/gcc.c-torture/compile/pr85401.c > @@ -0,0 +1,18 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O2" } */ > + > +int h(void); > +int i(int); > + > +struct a b; > +struct a { > + unsigned c : 4; > +} d() { > + int e, f = b.c << 2, g = h(); > + for (; g;) > + ; > + if (e == 0) > + if (f) > + i(f); > + return b; > +} Can you please run this (and the other test case) through `indent -gnu'? Maciej
On Thu, Oct 10, 2019 at 09:41:35AM +0100, Maciej W. Rozycki wrote: > On Wed, 9 Oct 2019, coypu@sdf.org wrote: > > > diff --git a/gcc/testsuite/gcc.c-torture/compile/pr85401-2.c b/gcc/testsuite/gcc.c-torture/compile/pr85401-2.c > > new file mode 100644 > > index 0000000..1d68d0b > > --- /dev/null > > +++ b/gcc/testsuite/gcc.c-torture/compile/pr85401.c > > @@ -0,0 +1,18 @@ > > +/* { dg-do compile } */ > > +/* { dg-options "-O2" } */ > > + > > +int h(void); > > +int i(int); > > + > > +struct a b; > > +struct a { > > + unsigned c : 4; > > +} d() { > > + int e, f = b.c << 2, g = h(); > > + for (; g;) > > + ; > > + if (e == 0) > > + if (f) > > + i(f); > > + return b; > > +} > > Can you please run this (and the other test case) through `indent -gnu'? > > Maciej OK. 2019-10-09 Maya Rashish <coypu@sdf.org> * gcc.c-torture/compile/pr85401: New test. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr85401.c b/gcc/testsuite/gcc.c-torture/compile/pr85401.c new file mode 100644 index 00000000000..fa8fa19be59 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr85401.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int h (void); +int i (int); + +struct a b; +struct a +{ + unsigned c:4; +} d () +{ + int e, f = b.c << 2, g = h (); + for (; g;) + ; + if (e == 0) + if (f) + i (f); + return b; +}
On 10/10/19 3:14 AM, coypu@sdf.org wrote: > On Thu, Oct 10, 2019 at 09:41:35AM +0100, Maciej W. Rozycki wrote: >> On Wed, 9 Oct 2019, coypu@sdf.org wrote: >> >>> diff --git a/gcc/testsuite/gcc.c-torture/compile/pr85401-2.c b/gcc/testsuite/gcc.c-torture/compile/pr85401-2.c >>> new file mode 100644 >>> index 0000000..1d68d0b >>> --- /dev/null >>> +++ b/gcc/testsuite/gcc.c-torture/compile/pr85401.c >>> @@ -0,0 +1,18 @@ >>> +/* { dg-do compile } */ >>> +/* { dg-options "-O2" } */ >>> + >>> +int h(void); >>> +int i(int); >>> + >>> +struct a b; >>> +struct a { >>> + unsigned c : 4; >>> +} d() { >>> + int e, f = b.c << 2, g = h(); >>> + for (; g;) >>> + ; >>> + if (e == 0) >>> + if (f) >>> + i(f); >>> + return b; >>> +} >> Can you please run this (and the other test case) through `indent -gnu'? >> >> Maciej > OK. > > 2019-10-09 Maya Rashish <coypu@sdf.org> > * gcc.c-torture/compile/pr85401: New test. Installed. Note the formatting is still rather goofy, but that's because "struct a" is defined within the context of the return type of d(). But rather than fix that up, I kept the test as-is. jeff
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr85401-2.c b/gcc/testsuite/gcc.c-torture/compile/pr85401-2.c new file mode 100644 index 0000000..1d68d0b --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr85401.c @@ -0,0 +1,18 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int h(void); +int i(int); + +struct a b; +struct a { + unsigned c : 4; +} d() { + int e, f = b.c << 2, g = h(); + for (; g;) + ; + if (e == 0) + if (f) + i(f); + return b; +}