1 /* Checks for a bug where static data with a section attribute within a
2 function would stop the function being partitioned into hot and cold
4 /* { dg-require-effective-target freorder } */
5 /* { dg-options "-O2 -fno-profile-reorder-functions -freorder-blocks-and-partition -save-temps" } */
9 #define NOINLINE __attribute__((noinline)) __attribute__ ((noclone))
11 const char *sarr
[SIZE
];
18 main (int argc
, char *argv
[])
23 for (i
= 0; i
< 1000000; i
++)
31 static int i
__attribute__((section(".data")));
34 for (i
= 0; i
< SIZE
; i
++)
39 for (i
= 0; i
< SIZE
; i
++)
44 /* { dg-final-use { scan-assembler "\.section\[\t \]*\.text\.unlikely\[\\n\\r\]+\[\t \]*\.size\[\t \]*foo\.cold\.0" { target *-*-linux* *-*-gnu* } } } */