1 ; This test should verify that adding !pcsections metadata is encoded properly
2 ; by the AsmPrinter. For tests to check that metadata is propagated to
3 ; assembly, see pcsections-*.ll tests.
5 ; RUN: llc -O0 < %s | FileCheck %s --check-prefixes=CHECK,DEFCM
6 ; RUN: llc -O1 < %s | FileCheck %s --check-prefixes=CHECK,DEFCM
7 ; RUN: llc -O2 < %s | FileCheck %s --check-prefixes=CHECK,DEFCM
8 ; RUN: llc -O3 < %s | FileCheck %s --check-prefixes=CHECK,DEFCM
9 ; RUN: llc -O1 -code-model=large < %s | FileCheck %s --check-prefixes=CHECK,LARGE
11 target triple = "x86_64-unknown-linux-gnu"
13 @foo = dso_local global i64 0, align 8
14 @bar = dso_local global i64 0, align 8
16 define void @empty_no_aux() !pcsections !0 {
17 ; CHECK-LABEL: empty_no_aux:
18 ; CHECK-NEXT: .Lfunc_begin0
19 ; CHECK: # %bb.0: # %entry
21 ; CHECK-NEXT: .Lfunc_end0:
22 ; CHECK: .section section_no_aux,"awo",@progbits,.{{l?}}text
23 ; CHECK-NEXT: .Lpcsection_base0:
24 ; DEFCM-NEXT: .long .Lfunc_begin0-.Lpcsection_base0
25 ; LARGE-NEXT: .quad .Lfunc_begin0-.Lpcsection_base0
26 ; CHECK-NEXT: .long .Lfunc_end0-.Lfunc_begin0
27 ; CHECK-NEXT: .{{l?}}text
32 define void @empty_aux() !pcsections !1 {
33 ; CHECK-LABEL: empty_aux:
34 ; CHECK-NEXT: .Lfunc_begin1
35 ; CHECK: # %bb.0: # %entry
37 ; CHECK-NEXT: .Lfunc_end1:
38 ; CHECK: .section section_aux,"awo",@progbits,.{{l?}}text
39 ; CHECK-NEXT: .Lpcsection_base1:
40 ; DEFCM-NEXT: .long .Lfunc_begin1-.Lpcsection_base1
41 ; LARGE-NEXT: .quad .Lfunc_begin1-.Lpcsection_base1
42 ; CHECK-NEXT: .long .Lfunc_end1-.Lfunc_begin1
43 ; CHECK-NEXT: .long 10
44 ; CHECK-NEXT: .long 20
45 ; CHECK-NEXT: .long 30
46 ; CHECK-NEXT: .{{l?}}text
51 define i64 @multiple() !pcsections !0 {
52 ; CHECK-LABEL: multiple:
53 ; CHECK-NEXT: .Lfunc_begin2
54 ; CHECK: # %bb.0: # %entry
55 ; CHECK: .Lpcsection0:
58 ; CHECK-NEXT: .Lfunc_end2:
59 ; CHECK: .section section_no_aux,"awo",@progbits,.{{l?}}text
60 ; CHECK-NEXT: .Lpcsection_base2:
61 ; DEFCM-NEXT: .long .Lfunc_begin2-.Lpcsection_base2
62 ; LARGE-NEXT: .quad .Lfunc_begin2-.Lpcsection_base2
63 ; CHECK-NEXT: .long .Lfunc_end2-.Lfunc_begin2
64 ; CHECK-NEXT: .section section_aux_42,"awo",@progbits,.{{l?}}text
65 ; CHECK-NEXT: .Lpcsection_base3:
66 ; DEFCM-NEXT: .long .Lpcsection0-.Lpcsection_base3
67 ; LARGE-NEXT: .quad .Lpcsection0-.Lpcsection_base3
68 ; CHECK-NEXT: .long 42
69 ; CHECK-NEXT: .section section_aux_21264,"awo",@progbits,.{{l?}}text
70 ; CHECK-NEXT: .Lpcsection_base4:
71 ; DEFCM-NEXT: .long .Lpcsection0-.Lpcsection_base4
72 ; LARGE-NEXT: .quad .Lpcsection0-.Lpcsection_base4
73 ; CHECK-NEXT: .long 21264
74 ; CHECK-NEXT: .{{l?}}text
76 %0 = load i64, ptr @bar, align 8, !pcsections !2
80 define void @multiple_uleb128() !pcsections !6 {
81 ; CHECK-LABEL: multiple_uleb128:
82 ; CHECK: .section section_aux,"awo",@progbits,.{{l?}}text
83 ; CHECK-NEXT: .Lpcsection_base5:
84 ; DEFCM-NEXT: .long .Lfunc_begin3-.Lpcsection_base5
85 ; LARGE-NEXT: .quad .Lfunc_begin3-.Lpcsection_base5
86 ; CHECK-NEXT: .uleb128 .Lfunc_end3-.Lfunc_begin3
87 ; CHECK-NEXT: .byte 42
88 ; CHECK-NEXT: .ascii "\345\216&"
89 ; CHECK-NEXT: .byte 255
90 ; CHECK-NEXT: .section section_aux_21264,"awo",@progbits,.{{l?}}text
91 ; CHECK-NEXT: .Lpcsection_base6:
92 ; DEFCM-NEXT: .long .Lfunc_begin3-.Lpcsection_base6
93 ; LARGE-NEXT: .quad .Lfunc_begin3-.Lpcsection_base6
94 ; CHECK-NEXT: .long .Lfunc_end3-.Lfunc_begin3
95 ; CHECK-NEXT: .long 21264
96 ; CHECK-NEXT: .{{l?}}text
101 !0 = !{!"section_no_aux"}
102 !1 = !{!"section_aux", !3}
103 !2 = !{!"section_aux_42", !4, !"section_aux_21264", !5}
104 !3 = !{i32 10, i32 20, i32 30}
107 !6 = !{!"section_aux!C", !7, !"section_aux_21264", !5}
108 !7 = !{i64 42, i32 624485, i8 255}