1 ; RUN: llc -mtriple x86_64-linux-gnu -function-sections %s -o - | FileCheck %s --check-prefix=ELF
2 ; RUN: llc -mtriple x86_64-linux-gnu -unique-section-names=0 -function-sections %s -o - | FileCheck %s --check-prefix=ELF-NOUNIQ
3 ; RUN: llc -mtriple x86_64-windows-msvc -function-sections %s -o - | FileCheck %s --check-prefix=COFF-MSVC
4 ; RUN: llc -mtriple x86_64-windows-gnu -function-sections %s -o - | FileCheck %s --check-prefix=COFF-GNU
6 define void @foo1(i1 zeroext %0) nounwind !section_prefix !0 {
7 ;; Check hot section name
8 ; ELF: .section .text.hot.foo1,"ax",@progbits
9 ; ELF-NOUNIQ: .section .text.hot.,"ax",@progbits,unique,1
10 ; COFF-MSVC: .section .text$hot,"xr",one_only,foo1
11 ; COFF-GNU: .section .text$hot$foo1,"xr",one_only,foo1
15 define void @foo2(i1 zeroext %0) nounwind !section_prefix !1 {
16 ;; Check unlikely section name
17 ; ELF: .section .text.unlikely.foo2,"ax",@progbits
18 ; ELF-NOUNIQ: .section .text.unlikely.,"ax",@progbits,unique,2
19 ; COFF-MSVC: .section .text$unlikely,"xr",one_only,foo2
20 ; COFF-GNU: .section .text$unlikely$foo2,"xr",one_only,foo2
24 !0 = !{!"function_section_prefix", !"hot"}
25 !1 = !{!"function_section_prefix", !"unlikely"}