brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.5 KiB · a5c456b Raw
126 lines · plain
1; REQUIRES: x86-registered-target2; RUN: opt < %s -passes='pseudo-probe,cgscc(inline)' -function-sections -S -o %t3; RUN: FileCheck %s < %t --check-prefix=CHECK-IL4; For ELF.5; RUN: llc -function-sections -mtriple=x86_64-unknown-linux-gnu <%t -filetype=asm -o %t16; RUN: FileCheck %s < %t1 --check-prefixes=CHECK-ASM,CHECK-ASM-ELF7; RUN: llc -function-sections -mtriple=x86_64-unknown-linux-gnu <%t -filetype=obj -o %t28; RUN: llvm-objdump --section-headers %t2 | FileCheck %s --check-prefix=CHECK-OBJ9; RUN: llvm-mc -triple=x86_64-unknown-linux-gnu -filetype=asm <%t1 -o %t310; RUN: FileCheck %s < %t3 --check-prefixes=CHECK-ASM,CHECK-ASM-ELF11; RUN: llvm-mc -triple=x86_64-unknown-linux-gnu -filetype=obj <%t1 -o %t412; RUN: llvm-objdump --section-headers %t4 | FileCheck %s --check-prefix=CHECK-OBJ13; For COFF.14; RUN: llc -function-sections -mtriple=x86_64-unknown-windows-msvc <%t -filetype=asm -o %t115; RUN: FileCheck %s < %t1 --check-prefixes=CHECK-ASM,CHECK-ASM-COFF16; RUN: llc -function-sections -mtriple=x86_64-unknown-windows-msvc <%t -filetype=obj -o %t217; RUN: llvm-objdump --section-headers %t2 | FileCheck %s --check-prefixes=CHECK-OBJ18; RUN: llvm-mc -triple=x86_64-unknown-windows-msvc -filetype=asm <%t1 -o %t319; RUN: FileCheck %s < %t3 --check-prefixes=CHECK-ASM,CHECK-ASM-COFF20; RUN: llvm-mc -triple=x86_64-unknown-windows-msvc -filetype=obj <%t1 -o %t421; RUN: llvm-objdump --section-headers %t4 | FileCheck %s --check-prefixes=CHECK-OBJ22 23 24define dso_local void @foo2() !dbg !7 {25; CHECK-IL:  call void @llvm.pseudoprobe(i64 [[#GUID1:]], i64 1, i32 0, i64 -1), !dbg ![[#]]26; CHECK-ASM: .pseudoprobe	[[#GUID1:]] 1 0 0 foo227  ret void, !dbg !1028}29 30define dso_local void @foo() #0 !dbg !11 {31; CHECK-IL:  call void @llvm.pseudoprobe(i64 [[#GUID2:]], i64 1, i32 0, i64 -1), !dbg ![[#]]32; CHECK-IL:  call void @llvm.pseudoprobe(i64 [[#GUID1]], i64 1, i32 0, i64 -1), !dbg ![[#DL1:]]33; CHECK-ASM: .pseudoprobe	[[#GUID2:]] 1 0 0 foo34; CHECK-ASM: .pseudoprobe	[[#GUID1]] 1 0 0 @ [[#GUID2]]:2 foo35  call void @foo2(), !dbg !1236  ret void, !dbg !1337}38 39define dso_local i32 @entry() !dbg !14 {40; CHECK-IL:  call void @llvm.pseudoprobe(i64 [[#GUID3:]], i64 1, i32 0, i64 -1), !dbg ![[#]]41; CHECK-IL:  call void @llvm.pseudoprobe(i64 [[#GUID2]], i64 1, i32 0, i64 -1), !dbg ![[#DL2:]]42; CHECK-IL:  call void @llvm.pseudoprobe(i64 [[#GUID1]], i64 1, i32 0, i64 -1), !dbg ![[#DL3:]]43; CHECK-ASM: .pseudoprobe	[[#GUID3:]] 1 0 0 entry44; CHECK-ASM: .pseudoprobe	[[#GUID2]] 1 0 0 @ [[#GUID3]]:2 entry45; CHECK-ASM: .pseudoprobe	[[#GUID1]] 1 0 0 @ [[#GUID3]]:2 @ [[#GUID2]]:2 entry46  call void @foo(), !dbg !1847  ret i32 0, !dbg !1948}49 50 51; CHECK-IL: ![[#SCOPE1:]] = distinct !DISubprogram(name: "foo2"52; CHECK-IL: ![[#SCOPE2:]] = distinct !DISubprogram(name: "foo"53; CHECK-IL: ![[#DL1]] = !DILocation(line: 3, column: 1,  scope: ![[#SCOPE1]], inlinedAt: ![[#INL1:]])54; CHECK-IL: ![[#INL1]] = distinct !DILocation(line: 7, column: 3, scope: ![[#BL1:]])55;; A discriminator of 455082007 which is 0x1b200017 in hexdecimal, stands for a direct call probe56;; with an index of 2 and a scale of 100%.57; CHECK-IL: ![[#BL1]] = !DILexicalBlockFile(scope: ![[#SCOPE2]], file: !1, discriminator: 455082007)58; CHECK-IL: ![[#SCOPE3:]] = distinct !DISubprogram(name: "entry"59; CHECK-IL: ![[#DL2]] = !DILocation(line: 7, column: 3,  scope: ![[#SCOPE2]], inlinedAt: ![[#INL2:]])60; CHECK-IL: ![[#INL2]] = distinct !DILocation(line: 11, column: 3, scope: ![[#BL2:]])61; CHECK-IL: ![[#BL2]] = !DILexicalBlockFile(scope: ![[#SCOPE3]], file: !1, discriminator: 455082007)62; CHECK-IL: ![[#DL3]] = !DILocation(line: 3, column: 1,  scope: ![[#SCOPE1]], inlinedAt: ![[#INL3:]])63; CHECK-IL: ![[#INL3]] = distinct !DILocation(line: 7, column: 3,  scope: ![[#BL1]], inlinedAt: ![[#INL2]])64 65 66; Check the generation of .pseudo_probe_desc section67; CHECK-ASM-ELF: .section .pseudo_probe_desc,"G",@progbits,.pseudo_probe_desc_foo2,comdat68; CHECK-ASM-ELF-NEXT: .quad [[#GUID1]]69; CHECK-ASM-ELF-NEXT: .quad [[#HASH1:]]70; CHECK-ASM-ELF-NEXT: .byte	471; CHECK-ASM-ELF-NEXT: .ascii "foo2"72; CHECK-ASM-ELF-NEXT: .section .pseudo_probe_desc,"G",@progbits,.pseudo_probe_desc_foo,comdat73; CHECK-ASM-ELF-NEXT: .quad [[#GUID2]]74; CHECK-ASM-ELF-NEXT: .quad [[#HASH2:]]75; CHECK-ASM-ELF-NEXT: .byte	376; CHECK-ASM-ELF-NEXT: .ascii "foo"77; CHECK-ASM-ELF-NEXT: .section .pseudo_probe_desc,"G",@progbits,.pseudo_probe_desc_entry,comdat78; CHECK-ASM-ELF-NEXT: .quad [[#GUID3]]79; CHECK-ASM-ELF-NEXT: .quad [[#HASH3:]]80; CHECK-ASM-ELF-NEXT: .byte	581; CHECK-ASM-ELF-NEXT: .ascii "entry"82; CHECK-ASM-COFF:      .section	.pseudo_probe_desc,"drD",same_contents,.pseudo_probe_desc_foo283; CHECK-ASM-COFF-NEXT: .pseudo_probe_desc_foo2:84; CHECK-ASM-COFF-NEXT: .quad	[[#GUID1]]85; CHECK-ASM-COFF-NEXT: .quad	[[#HASH1:]]86; CHECK-ASM-COFF-NEXT: .byte	487; CHECK-ASM-COFF-NEXT: .ascii	"foo2"88; CHECK-ASM-COFF-NEXT: .section	.pseudo_probe_desc,"drD",same_contents,.pseudo_probe_desc_foo89; CHECK-ASM-COFF:      .pseudo_probe_desc_foo:90; CHECK-ASM-COFF-NEXT: .quad	[[#GUID2]]91; CHECK-ASM-COFF-NEXT: .quad	[[#HASH2:]]92; CHECK-ASM-COFF-NEXT: .byte	393; CHECK-ASM-COFF-NEXT: .ascii	"foo"94; CHECK-ASM-COFF-NEXT: .section	.pseudo_probe_desc,"drD",same_contents,.pseudo_probe_desc_entry95; CHECK-ASM-COFF:      .pseudo_probe_desc_entry:96; CHECK-ASM-COFF-NEXT: .quad	[[#GUID3]]97; CHECK-ASM-COFF-NEXT: .quad	[[#HASH3:]]98; CHECK-ASM-COFF-NEXT: .byte	599; CHECK-ASM-COFF-NEXT: .ascii	"entry"100 101; CHECK-OBJ: .pseudo_probe_desc102; CHECK-OBJ: .pseudo_probe103; CHECK-OBJ-NOT: .rela.pseudo_probe104 105!llvm.dbg.cu = !{!0}106!llvm.module.flags = !{!3, !4}107 108!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, emissionKind: FullDebug)109!1 = !DIFile(filename: "foo.c", directory: "any")110!2 = !{}111!3 = !{i32 2, !"Dwarf Version", i32 4}112!4 = !{i32 2, !"Debug Info Version", i32 3}113!7 = distinct !DISubprogram(name: "foo2", scope: !1, file: !1, line: 2, type: !8, scopeLine: 2, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)114!8 = !DISubroutineType(types: !9)115!9 = !{null}116!10 = !DILocation(line: 3, column: 1, scope: !7)117!11 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 6, type: !8, scopeLine: 6, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)118!12 = !DILocation(line: 7, column: 3, scope: !11)119!13 = !DILocation(line: 8, column: 1, scope: !11)120!14 = distinct !DISubprogram(name: "entry", scope: !1, file: !1, line: 10, type: !15, scopeLine: 10, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)121!15 = !DISubroutineType(types: !16)122!16 = !{!17}123!17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)124!18 = !DILocation(line: 11, column: 3, scope: !14)125!19 = !DILocation(line: 12, column: 3, scope: !14)126