aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-02-16 12:21:31 -0800
committerIan Lance Taylor <iant@golang.org>2022-02-16 12:21:31 -0800
commitb43d6db9780462273c4d885a0111e3376c114c61 (patch)
tree0dff7e34fe65a75ba82e4a13d69991fdaea7c5eb /gcc/testsuite/gcc.dg
parent9419b14e109a2807361a9f695f5767f03dfa0cae (diff)
parent24ca97325cab7bc454c785d55f37120fe7ea6f74 (diff)
downloadgcc-b43d6db9780462273c4d885a0111e3376c114c61.zip
gcc-b43d6db9780462273c4d885a0111e3376c114c61.tar.gz
gcc-b43d6db9780462273c4d885a0111e3376c114c61.tar.bz2
Merge from trunk revision 24ca97325cab7bc454c785d55f37120fe7ea6f74.
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr102692-2.c22
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/pr104524.c9
-rw-r--r--gcc/testsuite/gcc.dg/analyzer/torture/pr102692.c (renamed from gcc/testsuite/gcc.dg/analyzer/pr102692.c)4
-rw-r--r--gcc/testsuite/gcc.dg/dfp/pr104510.c12
-rw-r--r--gcc/testsuite/gcc.dg/gomp/pr104517.c54
-rw-r--r--gcc/testsuite/gcc.dg/pr104511.c16
-rw-r--r--gcc/testsuite/gcc.dg/pr104522.c14
-rw-r--r--gcc/testsuite/gcc.dg/pr104526.c15
-rw-r--r--gcc/testsuite/gcc.dg/pr104544.c19
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr104519.c10
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr104543.c21
11 files changed, 194 insertions, 2 deletions
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr102692-2.c b/gcc/testsuite/gcc.dg/analyzer/pr102692-2.c
new file mode 100644
index 0000000..c72fde2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr102692-2.c
@@ -0,0 +1,22 @@
+/* { dg-additional-options "-O1" } */
+
+struct Lisp_Overlay
+{
+ struct Lisp_Overlay *next;
+};
+
+void
+test_1 (struct Lisp_Overlay *tail, long prev)
+{
+ long end;
+ if (!tail || end < prev || !tail->next) /* { dg-warning "use of uninitialized value 'end'" } */
+ return;
+}
+
+void
+test_2 (struct Lisp_Overlay *tail, long prev)
+{
+ long end;
+ if (tail && end < prev && !tail->next) /* { dg-warning "use of uninitialized value 'end'" } */
+ return;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr104524.c b/gcc/testsuite/gcc.dg/analyzer/pr104524.c
new file mode 100644
index 0000000..875098c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/analyzer/pr104524.c
@@ -0,0 +1,9 @@
+int src[1];
+
+int
+main (int c, char **a)
+{
+ __builtin_memcpy (*a, src, c);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr102692.c b/gcc/testsuite/gcc.dg/analyzer/torture/pr102692.c
index c8993c8..a6c6bc4 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr102692.c
+++ b/gcc/testsuite/gcc.dg/analyzer/torture/pr102692.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-O2 -Wno-analyzer-too-complex" } */
+/* { dg-additional-options "-Wno-analyzer-too-complex" } */
/* TODO: remove the need for -Wno-analyzer-too-complex. */
struct lisp;
@@ -73,7 +73,7 @@ fix_overlays_before (struct buffer *bp, long prev, long pos)
parent = tail;
tail = tail->next;
}
- if (!tail || end < prev || !tail->next) /* { dg-bogus "use of uninitialized value 'end'" "uninit" { xfail *-*-* } } */
+ if (!tail || end < prev || !tail->next) /* { dg-bogus "use of uninitialized value 'end'" "uninit" } */
/* { dg-bogus "dereference of NULL 'tail'" "null deref" { target *-*-* } .-1 } */
return;
right_pair = parent;
diff --git a/gcc/testsuite/gcc.dg/dfp/pr104510.c b/gcc/testsuite/gcc.dg/dfp/pr104510.c
new file mode 100644
index 0000000..85f4e97
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/dfp/pr104510.c
@@ -0,0 +1,12 @@
+/* PR c/104510 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+float f;
+_Decimal64 d;
+
+int
+foo (void)
+{
+ return d > (_Decimal32) (_Decimal64) f;
+}
diff --git a/gcc/testsuite/gcc.dg/gomp/pr104517.c b/gcc/testsuite/gcc.dg/gomp/pr104517.c
new file mode 100644
index 0000000..efb3175
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/gomp/pr104517.c
@@ -0,0 +1,54 @@
+/* PR debug/104517 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fcompare-debug -fopenmp -fno-tree-ter -save-temps" } */
+
+enum {
+ omp_default_mem_alloc,
+ omp_large_cap_mem_alloc,
+ omp_const_mem_alloc,
+ omp_high_bw_mem_alloc
+} omp_allocator_handle_t;
+
+int t, bar_nte, bar_tl, bar_i3, bar_dd;
+
+#pragma omp threadprivate(t)
+#pragma omp declare target
+int f, l, ll, r, r2;
+#pragma omp end declare target
+
+void
+bar (int *idp, int s, int nth, int g, int nta, int fi, int pp, int *q,
+ int ntm)
+{
+ int p = 0, i2 = 0, i1 = 0, m = 0, d = 0;
+
+#pragma omp target parallel for \
+ device(p) firstprivate (f) allocate (f) in_reduction(+:r2)
+ for (int i = 0; i < 4; i++)
+ ll++;
+
+#pragma omp target parallel for \
+ device(d) map (m) \
+ if (target: p) firstprivate (f) defaultmap(tofrom: scalar) is_device_ptr (idp) \
+ if (parallel: i2) reduction(+:r) num_threads (nth) linear (ll) \
+ schedule(static) collapse(1) nowait depend(inout: d) allocate (f) \
+ in_reduction(+:r2)
+ for (int i = 0; i < 4; i++)
+ ll++;
+
+#pragma omp taskloop simd firstprivate(f) lastprivate(s) grainsize(g) \
+ collapse(1) untied if (i1) final(fi) mergeable nogroup \
+ priority(pp) linear(ll) aligned(q) allocate(f)
+ for (int i = 0; i < 4; i++)
+ ll++;
+
+#pragma omp taskloop simd firstprivate(f) lastprivate(s) num_tasks(nta) \
+ collapse(1) if (i1) final(fi) priority(pp) safelen(8) simdlen(4) \
+ linear(ll) aligned(q) nontemporal(ntm) order(concurrent) allocate(f)
+ for (int i = 0; i < 4; i++)
+ ll++;
+
+#pragma omp parallel master firstprivate(f) shared(nth) proc_bind(spread) \
+ copyin(t) allocate(f)
+ ;
+}
diff --git a/gcc/testsuite/gcc.dg/pr104511.c b/gcc/testsuite/gcc.dg/pr104511.c
new file mode 100644
index 0000000..ad5430c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr104511.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target dfp } } */
+/* { dg-options "-O -Wno-psabi" } */
+
+typedef _Float64 __attribute__((__vector_size__ (32))) F;
+typedef _Decimal32 __attribute__((__vector_size__ (16))) D;
+
+extern void bar (void);
+
+D g;
+void
+foo (F f)
+{
+ D d = __builtin_convertvector (f, D);
+ bar ();
+ g = d;
+}
diff --git a/gcc/testsuite/gcc.dg/pr104522.c b/gcc/testsuite/gcc.dg/pr104522.c
new file mode 100644
index 0000000..4d1d630
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr104522.c
@@ -0,0 +1,14 @@
+/* PR middle-end/104522 */
+/* { dg-do compile } */
+/* { dg-options "-O -fcompare-debug -dP" } */
+
+typedef short __attribute__((__vector_size__(16))) V;
+long double x;
+
+void
+foo (void)
+{
+ V t = { 512, 0, 0, 0, 16384 };
+ long double u = *(long double *) &t;
+ x /= u;
+}
diff --git a/gcc/testsuite/gcc.dg/pr104526.c b/gcc/testsuite/gcc.dg/pr104526.c
new file mode 100644
index 0000000..a295308
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr104526.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-evrp" } */
+
+void foo(void);
+
+static int a, b = 1, *c = &b;
+int main() {
+ for (; a; a--) {
+ int d = 2 >> (1 / *c);
+ if (!d)
+ foo();
+ }
+}
+
+/* { dg-final { scan-tree-dump-not "foo" "evrp" } } */
diff --git a/gcc/testsuite/gcc.dg/pr104544.c b/gcc/testsuite/gcc.dg/pr104544.c
new file mode 100644
index 0000000..275b666
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr104544.c
@@ -0,0 +1,19 @@
+/* PR rtl-optimization/104544 */
+/* { dg-do compile { target int128 } } */
+/* { dg-options "-O2 -fcompare-debug" } */
+
+int m, n;
+__int128 q;
+
+void
+bar (unsigned __int128 x, int y)
+{
+ if (x)
+ q += y;
+}
+
+void
+foo (void)
+{
+ bar (!!q - 1, (m += m ? m : 1) < n);
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr104519.c b/gcc/testsuite/gcc.dg/torture/pr104519.c
new file mode 100644
index 0000000..389c7bb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr104519.c
@@ -0,0 +1,10 @@
+/* { dg-do run } */
+
+signed char a, b;
+int main()
+{
+ for (b = -7; b; b += 3)
+ if (a)
+ __builtin_abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/pr104543.c b/gcc/testsuite/gcc.dg/torture/pr104543.c
new file mode 100644
index 0000000..4896351
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr104543.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { dg-additional-options "-floop-unroll-and-jam" } */
+
+int a[3], b, c;
+static int e()
+{
+ if (!c) {
+ for (b = 0; b < 3; b++)
+ for (c = 0; c < 3; c++)
+ a[c] ^= 1;
+ return -1;
+ }
+ return 0;
+}
+int main()
+{
+ e();
+ if (a[1] != 1)
+ __builtin_abort();
+ return 0;
+}