...

Text file src/debug/dwarf/testdata/ranges.c

Documentation: debug/dwarf/testdata

     1// gcc -g -O2 -freorder-blocks-and-partition
     2
     3const char *arr[10000];
     4const char *hot = "hot";
     5const char *cold = "cold";
     6
     7__attribute__((noinline))
     8void 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
    22int main(int argc, char *argv[]) {
    23	fn(argc);
    24	return 0;
    25}

View as plain text