1 // REQUIRES: x86-registered-target
2 
3 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -o - < %s | FileCheck %s --check-prefix=PLAIN
4 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fbasic-block-sections=all -fbasic-block-sections=none -o - < %s | FileCheck %s --check-prefix=PLAIN
5 
6 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fbasic-block-sections=labels -o - < %s | FileCheck %s --check-prefix=BB_LABELS
7 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fbasic-block-sections=all -o - < %s | FileCheck %s --check-prefix=BB_WORLD --check-prefix=BB_ALL
8 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fbasic-block-sections=list=%S/Inputs/basic-block-sections.funcnames -o - < %s | FileCheck %s --check-prefix=BB_WORLD --check-prefix=BB_LIST
9 // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -S -fbasic-block-sections=all -funique-basic-block-section-names -o - < %s | FileCheck %s --check-prefix=UNIQUE
10 
world(int a)11 int world(int a) {
12   if (a > 10)
13     return 10;
14   else if (a > 5)
15     return 5;
16   else
17     return 0;
18 }
19 
another(int a)20 int another(int a) {
21   if (a > 10)
22     return 20;
23   return 0;
24 }
25 
26 // PLAIN-NOT: section
27 // PLAIN: world:
28 //
29 // BB_LABELS-NOT: section
30 // BB_LABELS: world:
31 // BB_LABELS: a.BB.world:
32 // BB_LABELS: aa.BB.world:
33 // BB_LABELS: a.BB.another:
34 //
35 // BB_WORLD: .section .text.world,"ax",@progbits{{$}}
36 // BB_WORLD: world:
37 // BB_WORLD: .section .text.world,"ax",@progbits,unique
38 // BB_WORLD: world.1:
39 // BB_WORLD: .section .text.another,"ax",@progbits
40 // BB_ALL: .section .text.another,"ax",@progbits,unique
41 // BB_ALL: another.1:
42 // BB_LIST-NOT: .section .text.another,"ax",@progbits,unique
43 // BB_LIST: another:
44 // BB_LIST-NOT: another.1:
45 //
46 // UNIQUE: .section .text.world.world.1,
47 // UNIQUE: .section .text.another.another.1,
48