regression tests for 103770 fixed on trunk
Checks
Commit Message
This adds regression tests for an ICE on valid code that
seems gone on trunk, but the cause is still unclear.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103770
regressions tests for PR103770
This adds tests from bugzilla for PR103770 and duplicates.
testsuite/gcc.dg/
* pr103770.c: New test.
* pr103859.c: New test.
* pr105065.c: New test.
Comments
On 12/22/22 13:13, Martin Uecker via Gcc-patches wrote:
>
> This adds regression tests for an ICE on valid code that
> seems gone on trunk, but the cause is still unclear.
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103770
>
>
>
> regressions tests for PR103770
>
> This adds tests from bugzilla for PR103770 and duplicates.
>
> testsuite/gcc.dg/
> * pr103770.c: New test.
> * pr103859.c: New test.
> * pr105065.c: New test.
OK. Though I suspect your ChangeLog will need adjustments to get past
the commit hooks.
gcc/testsuite
* gcc.dg/pr103770.c: New test.
Would be the proper format I think.
jeff
new file mode 100644
@@ -0,0 +1,27 @@
+/* PR middle-end/103770 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct struct_s {
+ void* ptr;
+ void* ptr2;
+ void* ptr3;
+};
+
+struct struct_s struct_create(int N, const long vla[N]);
+
+void fun(int N)
+{
+ long vla[N];
+ struct struct_s st = struct_create(N, vla);
+}
+
+
+extern _Complex float g(int N, int dims[N]);
+
+void f(void)
+{
+ int dims[1];
+ _Complex float val = g(1, dims);
+}
+
new file mode 100644
@@ -0,0 +1,23 @@
+/* PR middle-end/103859 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef struct dcmplx dcmplx;
+
+struct dcmplx {
+ double re;
+ double im;
+};
+
+dcmplx horner(int n, dcmplx p[n], dcmplx x);
+
+int main(void)
+{
+ int i, n;
+ dcmplx x[n + 1], f[n + 1];
+
+ horner(n + 1, f, x[i]);
+
+ return 0;
+}
+
new file mode 100644
@@ -0,0 +1,16 @@
+/* PR middle-end/105065 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+typedef struct
+{
+ char filler[17];
+} big_struct;
+
+big_struct dummy(int size, char array[size]);
+
+int main()
+{
+ dummy(0, 0);
+}
+