Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / basic-block-sections.c
bloba61b8dd4ac376f1e48a1582f87709ebb15857d94
1 // REQUIRES: x86-registered-target
3 // RUN: %clang_cc1 -triple x86_64 -S -o - < %s | FileCheck %s --check-prefix=PLAIN
4 // RUN: %clang_cc1 -triple x86_64 -S -fbasic-block-sections=all -fbasic-block-sections=none -o - < %s | FileCheck %s --check-prefix=PLAIN
6 // RUN: %clang_cc1 -triple x86_64 -S -fbasic-block-sections=all -o - < %s | FileCheck %s --check-prefix=BB_WORLD --check-prefix=BB_ALL
7 // 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_LIST
8 // RUN: %clang_cc1 -triple x86_64 -S -fbasic-block-sections=all -funique-basic-block-section-names -o - < %s | FileCheck %s --check-prefix=UNIQUE
9 // RUN: rm -f %t
10 // RUN: not %clang_cc1 -fbasic-block-sections=list= -emit-obj -o %t %s 2>&1 | FileCheck -DMSG=%errc_ENOENT %s --check-prefix=ERROR
11 // RUN: not ls %t
13 int world(int a) {
14 if (a > 10)
15 return 10;
16 else if (a > 5)
17 return 5;
18 else
19 return 0;
22 int another(int a) {
23 if (a > 10)
24 return 20;
25 return 0;
28 // PLAIN-NOT: section
29 // PLAIN: world:
31 // BB_WORLD: .section .text.world,"ax",@progbits{{$}}
32 // BB_WORLD: world:
33 // BB_WORLD: .section .text.world,"ax",@progbits,unique
34 // BB_WORLD: world.__part.1:
35 // BB_ALL: .section .text.another,"ax",@progbits
36 // BB_ALL: another.__part.1:
37 // BB_LIST-NOT: .section .text.another,"ax",@progbits
38 // BB_LIST: another:
39 // BB_LIST-NOT: another.__part.1:
41 // UNIQUE: .section .text.world.world.__part.1,
42 // UNIQUE: .section .text.another.another.__part.1,
43 // ERROR: error: unable to load basic block sections function list: '[[MSG]]'