blob: ba7130ca7dcdf70992dacd4a3f6b6c3d2716adb7 [file] [log] [blame]
From dc4c8dd9dbe70740ec7a684b0f35620249fb036a Mon Sep 17 00:00:00 2001
From: segher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 30 Aug 2019 13:53:11 +0000
Subject: [PATCH] Backport from trunk 2019-08-23 Segher Boessenkool
<segher@kernel.crashing.org>
gcc/testsuite/
PR target/91481
* gcc.target/powerpc/darn-3.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-9-branch@275176 138bc75d-0d04-0410-961f-82ee72b054a4
Upstream-Status: Backport
CVE: CVE-2019-15847 p3
Affects <= 9.2.0
Dropped Changelog changes
Signed-off-by: Armin Kuster <akuster@mvista.com>
---
gcc/testsuite/ChangeLog | 6 ++++++
gcc/testsuite/gcc.target/powerpc/darn-3.c | 16 ++++++++++++++++
2 files changed, 22 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/powerpc/darn-3.c
Index: gcc-9.2.0/gcc/testsuite/gcc.target/powerpc/darn-3.c
===================================================================
--- /dev/null
+++ gcc-9.2.0/gcc/testsuite/gcc.target/powerpc/darn-3.c
@@ -0,0 +1,16 @@
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-skip-if "" { powerpc*-*-aix* } } */
+/* { dg-options "-O2 -mdejagnu-cpu=power9" } */
+
+static int darn32(void) { return __builtin_darn_32(); }
+
+int four(void)
+{
+ int sum = 0;
+ int i;
+ for (i = 0; i < 4; i++)
+ sum += darn32();
+ return sum;
+}
+
+/* { dg-final { scan-assembler-times {(?n)\mdarn .*,0\M} 4 } } */
Index: gcc-9.2.0/gcc/testsuite/ChangeLog
===================================================================
--- gcc-9.2.0.orig/gcc/testsuite/ChangeLog
+++ gcc-9.2.0/gcc/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2019-08-30 Segher Boessenkool <segher@kernel.crashing.org>
+
+ Backport from trunk
+ 2019-08-23 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR target/91481
+ * gcc.target/powerpc/darn-3.c: New testcase.
+
2019-08-12 Release Manager
* GCC 9.2.0 released.