brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · bf08f91 Raw
31 lines · c
1// REQUIRES: x86-registered-target2 3// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -o - < %s | FileCheck %s --check-prefix=PLAIN4// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -ffunction-sections -o - < %s | FileCheck %s --check-prefix=FUNC_SECT5 6// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fdata-sections -o - < %s | FileCheck %s --check-prefix=DATA_SECT7 8// Try again through a clang invocation of the ThinLTO backend.9// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O2 %s -flto=thin -emit-llvm-bc -o %t.o10// RUN: llvm-lto -thinlto -o %t %t.o11// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc -S -ffunction-sections -o - | FileCheck %s --check-prefix=FUNC_SECT12// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc -S -fdata-sections -o - | FileCheck %s --check-prefix=DATA_SECT13 14const int hello = 123;15void world(void) {}16 17// PLAIN-NOT: section18// PLAIN: world:19// PLAIN: section .rodata,20// PLAIN: hello:21 22// FUNC_SECT: section .text.world,23// FUNC_SECT: world:24// FUNC_SECT: section .rodata,25// FUNC_SECT: hello:26 27// DATA_SECT-NOT: .section28// DATA_SECT: world:29// DATA_SECT: .section .rodata.hello,30// DATA_SECT: hello:31