aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-02-03 08:48:19 -0800
committerIan Lance Taylor <iant@golang.org>2021-02-03 08:48:19 -0800
commit305e9d2c7815e90a29bbde1e3a7cd776861f4d7c (patch)
tree32dedad81f42b67729aef302069fcee11132d215 /gcc/testsuite
parent8910f1cd79445bbe2da01f8ccf7c37909349529e (diff)
parent530203d6e3244c25eda4124f0fa5756ca9a5683e (diff)
downloadgcc-305e9d2c7815e90a29bbde1e3a7cd776861f4d7c.zip
gcc-305e9d2c7815e90a29bbde1e3a7cd776861f4d7c.tar.gz
gcc-305e9d2c7815e90a29bbde1e3a7cd776861f4d7c.tar.bz2
Merge from trunk revision 530203d6e3244c25eda4124f0fa5756ca9a5683e.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog70
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/noexcept65.C35
-rw-r--r--gcc/testsuite/g++.dg/cpp2a/no_unique_address11.C18
-rw-r--r--gcc/testsuite/gcc.dg/pr97487-1.c9
-rw-r--r--gcc/testsuite/gcc.dg/pr97487-2.c18
-rw-r--r--gcc/testsuite/gcc.dg/pr98287.c19
-rw-r--r--gcc/testsuite/gcc.target/i386/pr97971.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/pr98928.c59
-rw-r--r--gcc/testsuite/gfortran.dg/coarray/array_temporary.f9074
9 files changed, 314 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0614da1..a0c6e73 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,73 @@
+2021-02-02 Martin Liska <mliska@suse.cz>
+
+ PR target/97510
+ * gcc.target/i386/pr97510.c: New test.
+
+2021-02-02 Jason Merrill <jason@redhat.com>
+
+ PR c++/98929
+ * g++.dg/cpp1z/class-deduction-decltype1.C: New test.
+
+2021-02-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gcc.target/aarch64/narrow_high-intrinsics.c: Adjust sqxtun2 scan.
+
+2021-02-02 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/91862
+ * gfortran.dg/pr91862.f90: New test.
+
+2021-02-02 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gcc.target/aarch64/arg-type-diagnostics-1.c: Return result from foo.
+
+2021-02-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/98848
+ * gcc.dg/vect/pr98848.c: New test.
+ * gcc.dg/vect/pr92205.c: Remove xfail.
+
+2021-02-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/97960
+ * g++.dg/torture/pr97960.C: New test.
+
+2021-02-02 Kito Cheng <kito.cheng@sifive.com>
+
+ PR target/98743
+ * g++.dg/opt/pr98743.C: New.
+
+2021-02-02 Christophe Lyon <christophe.lyon@linaro.org>
+
+ * gcc.target/arm/simd/mve-vorn.c: Add vorn tests.
+
+2021-02-02 Alexandre Oliva <oliva@adacore.com>
+
+ * gcc.dg/asan/nested-1.c: New.
+
+2021-02-02 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/93355
+ PR analyzer/96374
+ * gcc.dg/analyzer/conditionals-3.c: Add "__analyzer_"
+ prefix to support subroutines where necessary.
+ * gcc.dg/analyzer/data-model-1.c: Likewise.
+ * gcc.dg/analyzer/feasibility-1.c (called_by_test_6a): New.
+ (test_6a): New.
+ * gcc.dg/analyzer/params.c: Add "__analyzer_" prefix to support
+ subroutines where necessary.
+ * gcc.dg/analyzer/pr96651-2.c: Likewise.
+ * gcc.dg/analyzer/signal-4b.c: Likewise.
+ * gcc.dg/analyzer/single-field.c: Likewise.
+ * gcc.dg/analyzer/torture/conditionals-2.c: Likewise.
+
+2021-02-02 David Malcolm <dmalcolm@redhat.com>
+
+ PR analyzer/93355
+ PR analyzer/96374
+ * gcc.dg/analyzer/pr93355-localealias-feasibility-2.c: New test.
+ * gcc.dg/analyzer/pr93355-localealias-feasibility-3.c: New test.
+
2021-02-01 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/narrow_high-intrinsics.c: Adjust rshrn2
diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept65.C b/gcc/testsuite/g++.dg/cpp0x/noexcept65.C
new file mode 100644
index 0000000..f593377
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/noexcept65.C
@@ -0,0 +1,35 @@
+// PR c++/98899
+// { dg-do compile { target c++11 } }
+
+template <int __v> struct integral_constant {
+ static constexpr int value = __v;
+};
+
+struct S {
+ template<class> struct B {
+ B() noexcept(noexcept(x));
+ int x;
+ };
+ struct A : B<int> {
+ A() : B() {}
+ };
+};
+
+struct S2 {
+ template<class> struct B {
+ B() noexcept(integral_constant<false>::value);
+ };
+ struct A : B<int> {
+ A() : B() {}
+ };
+};
+
+struct S3 {
+ template<class> struct B {
+ B() noexcept(b);
+ };
+ struct A : B<int> {
+ A() : B() {}
+ };
+ static constexpr bool b = false;
+};
diff --git a/gcc/testsuite/g++.dg/cpp2a/no_unique_address11.C b/gcc/testsuite/g++.dg/cpp2a/no_unique_address11.C
new file mode 100644
index 0000000..9ca6184
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/no_unique_address11.C
@@ -0,0 +1,18 @@
+// PR c++/97804
+// { dg-do compile { target c++17 } }
+
+template <typename a> struct b {
+ constexpr b() : c() {}
+ [[no_unique_address]] a c;
+};
+template <unsigned long, typename...> struct d;
+template <unsigned long e, typename a, typename... f>
+struct d<e, a, f...> : d<1, f...>, b<a> {};
+template <unsigned long e, typename a> struct d<e, a> : b<a> {};
+template <typename... g> class h : d<0, g...> {};
+struct i {};
+class j {
+ using k = int;
+ h<k, i> l;
+ float m = 0.025f;
+} n;
diff --git a/gcc/testsuite/gcc.dg/pr97487-1.c b/gcc/testsuite/gcc.dg/pr97487-1.c
new file mode 100644
index 0000000..e79d1f1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr97487-1.c
@@ -0,0 +1,9 @@
+/* PR middle-end/97487 */
+/* { dg-do compile } */
+/* { dg-options "-O2 --param max-rtl-if-conversion-unpredictable-cost=0" } */
+
+long int __attribute__ ((simd))
+foo (long int x, long int y)
+{
+ return x < 0 ? y : 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr97487-2.c b/gcc/testsuite/gcc.dg/pr97487-2.c
new file mode 100644
index 0000000..0b62381
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr97487-2.c
@@ -0,0 +1,18 @@
+/* PR middle-end/97487 */
+/* { dg-do compile } */
+/* { dg-options "-O2 --param max-rtl-if-conversion-unpredictable-cost=0 -Wno-psabi -w" } */
+
+typedef long long int V __attribute__((vector_size (16)));
+
+long long int
+foo (V x, V y)
+{
+ long long int t1 = y[0];
+ long long int t2 = x[0];
+ long long int t3;
+ if (t2 < 0)
+ t3 = t1;
+ else
+ t3 = 0;
+ return t3;
+}
diff --git a/gcc/testsuite/gcc.dg/pr98287.c b/gcc/testsuite/gcc.dg/pr98287.c
new file mode 100644
index 0000000..0314428
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr98287.c
@@ -0,0 +1,19 @@
+/* PR tree-optimization/98287 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-tree-ccp -fno-tree-forwprop -Wno-psabi -w" } */
+
+typedef unsigned long __attribute__((__vector_size__ (8))) V;
+V v;
+
+static __attribute__((noinline, noclone)) V
+bar (unsigned short s)
+{
+ return v >> s << s | v >> s >> 63;
+}
+
+unsigned long
+foo (void)
+{
+ V x = bar (1);
+ return x[0];
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr97971.c b/gcc/testsuite/gcc.target/i386/pr97971.c
new file mode 100644
index 0000000..d07a310
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr97971.c
@@ -0,0 +1,12 @@
+/* PR middle-end/97971 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int
+foo (void)
+{
+ register _Complex long a asm ("rax");
+ register int b asm ("rdx");
+ asm ("# %0 %1" : "=&r" (a), "=r" (b)); /* { dg-error "inconsistent operand constraints in an 'asm'" } */
+ return a;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr98928.c b/gcc/testsuite/gcc.target/i386/pr98928.c
new file mode 100644
index 0000000..9503b57
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr98928.c
@@ -0,0 +1,59 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-Ofast -march=skylake-avx512 -fwhole-program -w" } */
+
+typedef float MagickRealType;
+typedef short Quantum;
+float InterpolateMagickPixelPacket_alpha[1];
+int InterpolateMagickPixelPacket_i;
+
+void InterpolateMagickPixelPacket();
+
+void main() { InterpolateMagickPixelPacket(); }
+
+typedef struct {
+ MagickRealType red, green, blue, opacity, index;
+} MagickPixelPacket;
+typedef struct {
+ Quantum blue, green, red, opacity;
+} PixelPacket;
+struct _Image {
+ int colorspace;
+ int matte;
+} GetMagickPixelPacket(MagickPixelPacket *pixel) {
+ pixel->red = pixel->green = pixel->blue = 0.0;
+}
+int AlphaBlendMagickPixelPacket(struct _Image *image, PixelPacket *color,
+ Quantum *indexes, MagickPixelPacket *pixel,
+ MagickRealType *alpha) {
+ if (image->matte) {
+ *alpha = pixel->red = pixel->green = pixel->blue = pixel->opacity =
+ color->opacity;
+ pixel->index = 0.0;
+ if (image->colorspace)
+ pixel->index = *indexes;
+ return 0;
+ }
+ *alpha = 1.0 / 0.2;
+ pixel->red = *alpha * color->red;
+ pixel->green = *alpha * color->green;
+ pixel->blue = *alpha * color->blue;
+ pixel->opacity = pixel->index = 0.0;
+ if (image->colorspace && indexes)
+ pixel->index = *indexes;
+}
+MagickPixelPacket InterpolateMagickPixelPacket_pixels[1];
+PixelPacket InterpolateMagickPixelPacket_p;
+
+void
+InterpolateMagickPixelPacket(struct _Image *image) {
+ Quantum *indexes;
+ for (; InterpolateMagickPixelPacket_i; InterpolateMagickPixelPacket_i++) {
+ GetMagickPixelPacket(InterpolateMagickPixelPacket_pixels +
+ InterpolateMagickPixelPacket_i);
+ AlphaBlendMagickPixelPacket(
+ image, &InterpolateMagickPixelPacket_p + InterpolateMagickPixelPacket_i,
+ indexes + InterpolateMagickPixelPacket_i,
+ InterpolateMagickPixelPacket_pixels + InterpolateMagickPixelPacket_i,
+ InterpolateMagickPixelPacket_alpha + InterpolateMagickPixelPacket_i);
+ }
+}
diff --git a/gcc/testsuite/gfortran.dg/coarray/array_temporary.f90 b/gcc/testsuite/gfortran.dg/coarray/array_temporary.f90
new file mode 100644
index 0000000..86460a7
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/coarray/array_temporary.f90
@@ -0,0 +1,74 @@
+! { dg-do compile }
+! { dg-additional-options "-Warray-temporaries" }
+!
+! PR fortran/98913
+!
+! Contributed by Jorge D'Elia
+!
+! Did create an array temporary for local access to coarray
+! (but not for identical noncoarray use).
+!
+
+program test
+ implicit none
+ integer, parameter :: iin = kind (1)
+ integer, parameter :: idp = kind (1.0d0)
+ real (kind=idp), allocatable :: AA (:,:)[:]
+ real (kind=idp), allocatable :: BB (:,:)
+ real (kind=idp), allocatable :: UU (:)
+ integer (kind=iin) :: nn, n1, n2
+ integer (kind=iin) :: j, k, k1
+ !
+ nn = 5
+ n1 = 1
+ n2 = 10
+ !
+ allocate (AA (1:nn,n1:n2)[*])
+ allocate (BB (1:nn,n1:n2))
+ allocate (UU (1:nn))
+ !
+ k = 1
+ k1 = k + 1
+ !
+ AA = 1.0_idp
+ BB = 1.0_idp
+ UU = 2.0_idp
+
+ ! AA - coarrays
+ ! No temporary needed:
+ do j = 1, nn
+ AA (k1:nn,j) = AA (k1:nn,j) - UU (k1:nn) * AA (k,j) ! { dg-bogus "Creating array temporary" }
+ end do
+ do j = 1, nn
+ AA (k1:nn,j) = AA (k1:nn,j) - UU (k1:nn) * AA (k,j) - UU(k) * AA (k1-1:nn-1,j) ! { dg-bogus "Creating array temporary" }
+ end do
+ do j = 1, nn
+ AA (k1:nn,j) = AA (k1:nn,j) - UU (k1:nn) * AA (k,j) - UU(k) * AA (k1+1:nn+1,j) ! { dg-bogus "Creating array temporary" }
+ end do
+
+ ! But:
+ do j = 1, nn
+ AA (k1:nn,j) = AA (k1-1:nn-1,j) - UU (k1:nn) * AA (k,j) - UU(k) * AA (k1+1:nn+1,j) ! { dg-warning "Creating array temporary" }
+ end do
+
+ ! BB - no coarrays
+ ! No temporary needed:
+ do j = 1, nn
+ BB (k1:nn,j) = BB (k1:nn,j) - UU (k1:nn) * BB (k,j) ! { dg-bogus "Creating array temporary" }
+ end do
+ do j = 1, nn
+ BB (k1:nn,j) = BB (k1:nn,j) - UU (k1:nn) * BB (k,j) - UU(k) * BB (k1-1:nn-1,j) ! { dg-bogus "Creating array temporary" }
+ end do
+ do j = 1, nn
+ BB (k1:nn,j) = BB (k1:nn,j) - UU (k1:nn) * BB (k,j) - UU(k) * BB (k1+1:nn+1,j) ! { dg-bogus "Creating array temporary" }
+ end do
+
+ ! But:
+ do j = 1, nn
+ BB (k1:nn,j) = BB (k1-1:nn-1,j) - UU (k1:nn) * BB (k,j) - UU(k) * BB (k1+1:nn+1,j) ! { dg-warning "Creating array temporary" }
+ end do
+
+ deallocate (AA)
+ deallocate (BB)
+ deallocate (UU)
+end program test