1// This test checks that the data object located in text section
2// is properly emitted in the new section.
3
4// RUN: %clang %cflags %s -o %t.exe -Wl,-q
5// RUN: llvm-bolt %t.exe -o %t.bolt --lite=0 --use-old-text=0
6// RUN: llvm-objdump -j .text -d --disassemble-symbols=arr %t.bolt | \
7// RUN: FileCheck %s
8
9// CHECK: {{.*}} <arr>:
10
11extern void exit(int);
12
13typedef void (*FooPtr)();
14
15void exitOk() { exit(0); }
16
17__attribute__((section(".text"))) const FooPtr arr[] = {exitOk, 0};
18
19int main() {
20 arr[0]();
21 return -1;
22}
23

source code of bolt/test/AArch64/text-data.c