Debian Codegraph @

llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/x86-basic.ll.expected

raw
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ;; Check that we accept functions with '$' in the name.
3 ; RUN: llc -mtriple=x86_64 < %s | FileCheck %s
4
5 ;; Check that we accept .Ldsolocal$local: below the function label.
6 ; RUN: llc -mtriple=x86_64 -relocation-model=pic < %s | FileCheck %s --check-prefix=PIC
7
8 ;; Check that we accept .seh_proc below the function label.
9 ; RUN: llc -mtriple=x86_64-windows -relocation-model=pic < %s | FileCheck %s --check-prefix=WIN
10
11 @gv0 = dso_local global i32 0, align 4
12 @gv1 = dso_preemptable global i32 0, align 4
13
14 define hidden i32 @"_Z54bar$ompvariant$bar"() {
15 ; CHECK-LABEL: _Z54bar$ompvariant$bar:
16 ; CHECK: # %bb.0: # %entry
17 ; CHECK-NEXT: movl $2, %eax
18 ; CHECK-NEXT: retq
19 ;
20 ; PIC-LABEL: _Z54bar$ompvariant$bar:
21 ; PIC: # %bb.0: # %entry
22 ; PIC-NEXT: movl $2, %eax
23 ; PIC-NEXT: retq
24 ;
25 ; WIN-LABEL: _Z54bar$ompvariant$bar:
26 ; WIN: # %bb.0: # %entry
27 ; WIN-NEXT: movl $2, %eax
28 ; WIN-NEXT: retq
29 entry:
30 ret i32 2
31 }
32
33 define dso_local i32 @dsolocal() {
34 ; CHECK-LABEL: dsolocal:
35 ; CHECK: # %bb.0: # %entry
36 ; CHECK-NEXT: pushq %rax
37 ; CHECK-NEXT: .cfi_def_cfa_offset 16
38 ; CHECK-NEXT: callq ext@PLT
39 ; CHECK-NEXT: movl $2, %eax
40 ; CHECK-NEXT: popq %rcx
41 ; CHECK-NEXT: .cfi_def_cfa_offset 8
42 ; CHECK-NEXT: retq
43 ;
44 ; PIC-LABEL: dsolocal:
45 ; PIC: # %bb.0: # %entry
46 ; PIC-NEXT: pushq %rax
47 ; PIC-NEXT: .cfi_def_cfa_offset 16
48 ; PIC-NEXT: callq ext@PLT
49 ; PIC-NEXT: movl $2, %eax
50 ; PIC-NEXT: popq %rcx
51 ; PIC-NEXT: .cfi_def_cfa_offset 8
52 ; PIC-NEXT: retq
53 ;
54 ; WIN-LABEL: dsolocal:
55 ; WIN: # %bb.0: # %entry
56 ; WIN-NEXT: subq $40, %rsp
57 ; WIN-NEXT: .seh_stackalloc 40
58 ; WIN-NEXT: .seh_endprologue
59 ; WIN-NEXT: callq ext
60 ; WIN-NEXT: movl $2, %eax
61 ; WIN-NEXT: .seh_startepilogue
62 ; WIN-NEXT: addq $40, %rsp
63 ; WIN-NEXT: .seh_endepilogue
64 ; WIN-NEXT: retq
65 ; WIN-NEXT: .seh_endproc
66 entry:
67 call void @ext()
68 ret i32 2
69 }
70
71 declare void @ext()
72
73 define i32 @load() {
74 ; CHECK-LABEL: load:
75 ; CHECK: # %bb.0: # %entry
76 ; CHECK-NEXT: movl gv0(%rip), %eax
77 ; CHECK-NEXT: movq gv1@GOTPCREL(%rip), %rcx
78 ; CHECK-NEXT: addl (%rcx), %eax
79 ; CHECK-NEXT: retq
80 ;
81 ; PIC-LABEL: load:
82 ; PIC: # %bb.0: # %entry
83 ; PIC-NEXT: movl .Lgv0$local(%rip), %eax
84 ; PIC-NEXT: movq gv1@GOTPCREL(%rip), %rcx
85 ; PIC-NEXT: addl (%rcx), %eax
86 ; PIC-NEXT: retq
87 ;
88 ; WIN-LABEL: load:
89 ; WIN: # %bb.0: # %entry
90 ; WIN-NEXT: movl gv0(%rip), %eax
91 ; WIN-NEXT: addl gv1(%rip), %eax
92 ; WIN-NEXT: retq
93 entry:
94 %a = load i32, i32* @gv0
95 %b = load i32, i32* @gv1
96 %c = add i32 %a, %b
97 ret i32 %c
98 }
99
100 declare i32 @pers(...)
101
102 define i32 @eh() personality ptr @pers {
103 ; CHECK-LABEL: eh:
104 ; CHECK: # %bb.0:
105 ; CHECK-NEXT: xorl %eax, %eax
106 ; CHECK-NEXT: retq
107 ;
108 ; PIC-LABEL: eh:
109 ; PIC: # %bb.0:
110 ; PIC-NEXT: xorl %eax, %eax
111 ; PIC-NEXT: retq
112 ;
113 ; WIN-LABEL: eh:
114 ; WIN: # %bb.0:
115 ; WIN-NEXT: xorl %eax, %eax
116 ; WIN-NEXT: retq
117 ; WIN-NEXT: .Lfunc_end0:
118 ; WIN-NEXT: .seh_handlerdata
119 ; WIN-NEXT: .text
120 ; WIN-NEXT: .seh_endproc
121 ret i32 0
122 }