+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-08-16 Iain Sandoe <iain@sandoe.co.uk>
* gcc.dg/asan/pr81923.c: Stringify __USER_LABEL_PREFIX__.
void foo (int path);
+#ifdef __APPLE__
+__attribute__ ((section ("__TEXT,__text")))
+#else
__attribute__((section(".text")))
+#endif
int
main (int argc, char *argv[])
{
}
/* { 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* } } } */
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++)
}
/* { 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* } } } */
#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);
}
/* { 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* } } } */