Revert "[TargetVersion] Only enable on RISC-V and AArch64" (#117110)
[llvm-project.git] / bolt / test / reorder-data-writable-ptload.c
blobfa9918779463a7ed4a0936d99588617436e06568
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
5 // RISC-V.
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;
20 void _start() {
21 hot1++;
22 _start();