Text file src/debug/dwarf/testdata/ranges.c
1 // gcc -g -O2 -freorder-blocks-and-partition 2 3 const char *arr[10000]; 4 const char *hot = "hot"; 5 const char *cold = "cold"; 6 7 __attribute__((noinline)) 8 void fn(int path) { 9 int i; 10 11 if (path) { 12 for (i = 0; i < sizeof arr / sizeof arr[0]; i++) { 13 arr[i] = hot; 14 } 15 } else { 16 for (i = 0; i < sizeof arr / sizeof arr[0]; i++) { 17 arr[i] = cold; 18 } 19 } 20 } 21 22 int main(int argc, char *argv[]) { 23 fn(argc); 24 return 0; 25 } 26