diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2018-08-16 10:33:03 +0000 |
---|---|---|
committer | Iain Sandoe <iains@gcc.gnu.org> | 2018-08-16 10:33:03 +0000 |
commit | 02e13564acc1984a82e13ecd72542a594ff23a58 (patch) | |
tree | 230476763eea7b38089af1046afc0a20b5bf00a2 /gcc/testsuite | |
parent | a77042b50c292a128fbd4178b5633bf60a174804 (diff) | |
download | gcc-02e13564acc1984a82e13ecd72542a594ff23a58.zip gcc-02e13564acc1984a82e13ecd72542a594ff23a58.tar.gz gcc-02e13564acc1984a82e13ecd72542a594ff23a58.tar.bz2 |
fix section naming convention for Darwin in three tests
2018-08-15 Iain Sandoe <iain@sandoe.co.uk>
gcc/testsuite:
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.
6
From-SVN: r263583
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c | 5 |
4 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9ebf04d8..394c6c6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +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__. diff --git a/gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c b/gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c index ee6662e..1f99b31 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c +++ b/gcc/testsuite/gcc.dg/tree-prof/section-attr-1.c @@ -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* } } } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c b/gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c index 898a395..9bdc63a 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c +++ b/gcc/testsuite/gcc.dg/tree-prof/section-attr-2.c @@ -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* } } } */ diff --git a/gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c b/gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c index 36829dc..29eee45 100644 --- a/gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c +++ b/gcc/testsuite/gcc.dg/tree-prof/section-attr-3.c @@ -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* } } } */ |