1 // This test checks that reorder-data pass puts new hot .data section
2 // to the writable segment.
4 // Use -fPIC -pie to prevent the globals being put in .sdata instead of .data on
6 // RUN: %clang %cflags -fPIC -pie -O3 -nostdlib -Wl,-q %s -o %t.exe
7 // RUN: llvm-bolt %t.exe -o %t.bolt --reorder-data=".data" \
8 // RUN: -data %S/Inputs/reorder-data-writable-ptload.fdata
9 // RUN: llvm-readelf -SlW %t.bolt | FileCheck %s
11 // CHECK: .bolt.org.data
12 // CHECK: {{.*}} .data PROGBITS [[#%x,ADDR:]] [[#%x,OFF:]]
13 // CHECK: LOAD 0x{{.*}}[[#OFF]] 0x{{.*}}[[#ADDR]] {{.*}} RW
15 volatile int cold1
= 42;
16 volatile int hot1
= 42;
17 volatile int cold2
= 42;
18 volatile int cold3
= 42;