]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix tree-prof section tests on Darwin.
authorIain Sandoe <iain@sandoe.co.uk>
Mon, 24 Dec 2018 12:30:24 +0000 (12:30 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Mon, 24 Dec 2018 12:30:24 +0000 (12:30 +0000)
Add Darwin section names.

2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>

Backport from mainline
2018-08-16  Iain Sandoe <iain@sandoe.co.uk>

PR testsuite/78544
* gcc.dg/tree-prof/section-attr-1.c: Add Darwin-specific section
attributes and matching.
* gcc.dg/tree-prof/section-attr-2.c: Likewise.
* gcc.dg/tree-prof/section-attr-3.c: Likewise.

From-SVN: r267403

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c
gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c
gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c

index c6ff7dffac0d7969bcf657647701fb824026332f..e6398fcb7fad827a6fa4d1e69a9f4c15b4ac961f 100644 (file)
@@ -1,3 +1,14 @@
+2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>
+
+       Backport from mainline
+       2018-08-16  Iain Sandoe <iain@sandoe.co.uk>
+
+       PR testsuite/78544
+       * gcc.dg/tree-prof/section-attr-1.c: Add Darwin-specific section
+       attributes and matching.
+       * gcc.dg/tree-prof/section-attr-2.c: Likewise.
+       * gcc.dg/tree-prof/section-attr-3.c: Likewise.
+
 2018-12-23  Paul Thomas  <pault@gcc.gnu.org>
 
        Backport from trunk
index ee6662ea6e553c2d0b9f9fca4c0c386c80ee96ef..1f99b3128cc8278afbfd901ff2813d828d81a13f 100644 (file)
@@ -13,7 +13,11 @@ const char *buf_cold;
 
 void foo (int path);
 
+#ifdef __APPLE__
+__attribute__ ((section ("__TEXT,__text")))
+#else
 __attribute__((section(".text")))
+#endif
 int
 main (int argc, char *argv[])
 {
@@ -43,3 +47,4 @@ foo (int path)
 }
 
 /* { dg-final-use { scan-assembler "\.section\[\t \]*\.text\.unlikely\[\\n\\r\]+\[\t \]*\.size\[\t \]*foo\.cold\.0" { target *-*-linux* *-*-gnu* } } } */
+/* { dg-final-use { scan-assembler "\.section\[\t \]*__TEXT,__text_cold\.\*\[\\n\\r\]+_foo\.cold\.0" { target *-*-darwin* } } } */
index 898a395cd7ebfb70d667920f671edaea490eac88..9bdc63a1b0adb0db311b732d58ad50f05f11f4bf 100644 (file)
@@ -28,7 +28,11 @@ main (int argc, char *argv[])
 void NOINLINE
 foo (int path)
 {
+#ifdef __APPLE__
+  static int i __attribute__ ((section ("__DATA,__data")));
+#else
   static int i __attribute__((section(".data")));
+#endif
   if (path)
     {
       for (i = 0; i < SIZE; i++)
@@ -42,3 +46,4 @@ foo (int path)
 }
 
 /* { dg-final-use { scan-assembler "\.section\[\t \]*\.text\.unlikely\[\\n\\r\]+\[\t \]*\.size\[\t \]*foo\.cold\.0" { target *-*-linux* *-*-gnu* } } } */
+/* { dg-final-use { scan-assembler "\.section\[\t \]*__TEXT,__text_cold\.\*\[\\n\\r\]+_foo\.cold\.0:" { target *-*-darwin* } } } */
index 36829dcb7a0e4590ba1a46917afbcce6843378bb..29eee4587d6e87b76dcea6b58faf29a6b953493d 100644 (file)
@@ -9,7 +9,11 @@
 #define NOINLINE __attribute__((noinline)) __attribute__ ((noclone))
 
 const char *sarr[SIZE];
+#ifdef __APPLE__
+const char *buf_hot __attribute__ ((section ("__DATA,__data")));
+#else
 const char *buf_hot __attribute__ ((section (".data")));
+#endif
 const char *buf_cold;
 
 void foo (int path);
@@ -43,3 +47,4 @@ foo (int path)
 }
 
 /* { dg-final-use { scan-assembler "\.section\[\t \]*\.text\.unlikely\[\\n\\r\]+\[\t \]*\.size\[\t \]*foo\.cold\.0" { target *-*-linux* *-*-gnu* } } } */
+/* { dg-final-use { scan-assembler "\.section\[\t \]*__TEXT,__text_cold\.\*\[\\n\\r\]+_foo\.cold\.0:" { target *-*-darwin* } } } */