1 /* Checks for a bug where a function with a section attribute would prevent
2 all later functions from being partitioned into hot and cold blocks. */
3 /* { dg-require-effective-target freorder } */
4 /* { dg-options "-O2 -fno-profile-reorder-functions -freorder-blocks-and-partition -save-temps" } */
6 #ifdef FOR_AUTOFDO_TESTING
7 #define MAXITER 1000000
14 #define NOINLINE __attribute__((noinline)) __attribute__ ((noclone))
16 const char *sarr
[SIZE
];
23 __attribute__ ((section ("__TEXT,__text")))
25 __attribute__((section(".text")))
28 main (int argc
, char *argv
[])
33 for (i
= 0; i
< MAXITER
; i
++)
45 for (i
= 0; i
< SIZE
; i
++)
50 for (i
= 0; i
< SIZE
; i
++)
55 /* { dg-final-use-not-autofdo { scan-assembler "\.section\[\t \]*\.text\.unlikely\[\\n\\r\]+\[\t \]*\.size\[\t \]*foo\.cold" { target *-*-linux* *-*-gnu* } } } */
56 /* { dg-final-use-not-autofdo { scan-assembler {.section[\t ]*__TEXT,__text_cold[^\n]*[\n\r]+_foo.cold:} { target *-*-darwin* } } } */