aboutsummaryrefslogtreecommitdiff
path: root/bolt/test/AArch64/text-data.c
blob: f151ce89d4def6de638eb1963eb4406e98dcd881 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// This test checks that the data object located in text section
// is properly emitted in the new section.

// RUN: %clang %cflags %s -o %t.exe -Wl,-q,-z,undefs
// RUN: llvm-bolt %t.exe -o %t.bolt --lite=0 --use-old-text=0
// RUN: llvm-objdump -j .text -d --disassemble-symbols=arr %t.bolt | \
// RUN:   FileCheck %s

// CHECK: {{.*}} <arr>:

extern void exit(int);

typedef void (*FooPtr)();

void exitOk() { exit(0); }

__attribute__((section(".text"))) const FooPtr arr[] = {exitOk, 0};

int main() {
  arr[0]();
  return -1;
}