46 lines · c
1// REQUIRES: x86-registered-target2 3// RUN: %clang_cc1 -triple x86_64 -S -o - < %s | FileCheck %s --check-prefix=PLAIN4// RUN: %clang_cc1 -triple x86_64 -S -fbasic-block-sections=all -fbasic-block-sections=none -o - < %s | FileCheck %s --check-prefix=PLAIN5 6// RUN: %clang_cc1 -triple x86_64 -S -fbasic-block-sections=all -o - < %s | FileCheck %s --check-prefix=BB_WORLD --check-prefix=BB_ALL7// RUN: %clang_cc1 -triple x86_64 -S -fbasic-block-sections=list=%S/Inputs/basic-block-sections.funcnames -o - < %s | FileCheck %s --check-prefix=BB_WORLD --check-prefix=BB_LIST8// RUN: %clang_cc1 -triple x86_64 -S -fbasic-block-sections=all -funique-basic-block-section-names -o - < %s | FileCheck %s --check-prefix=UNIQUE9// RUN: rm -f %t10// RUN: not %clang_cc1 -fbasic-block-sections=list= -emit-obj -o %t %s 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=ERROR11// RUN: not ls %t12 13int world(int a) {14 if (a > 10)15 return 10;16 else if (a > 5)17 return 5;18 else19 return 0;20}21 22int another(int a) {23 if (a > 10)24 return 20;25 return 0;26}27 28// PLAIN-NOT: section29// PLAIN: world:30//31// BB_WORLD: .section .text.world,"ax",@progbits{{$}}32// BB_WORLD: world:33// BB_ALL: .section .text.world,"ax",@progbits,unique34// BB_ALL: world.__part.1:35// BB_LIST: .section .text.split.world,"ax",@progbits36// BB_LIST: world.cold:37// BB_ALL: .section .text.another,"ax",@progbits38// BB_ALL: another.__part.1:39// BB_LIST-NOT: .section .text.another,"ax",@progbits40// BB_LIST: another:41// BB_LIST-NOT: another.__part.1:42//43// UNIQUE: .section .text.world.world.__part.1,44// UNIQUE: .section .text.another.another.__part.1,45// ERROR: error: unable to load basic block sections function list: '[[MSG]]'46