1 ; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s
2 ; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ32 %s
3 ; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -O0 < %s | FileCheck --check-prefix=X64 %s
4 ; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ64 %s
6 ; This LL file was generated by running clang on the following code:
17 ; X86-NEXT: [[ASM_LINE:^L.*]]:{{$}}
18 ; X86: [[CALL_LINE:^L.*]]:{{$}}
20 ; X86-NEXT: [[RETURN_STMT:.*]]:
23 ; X86-NEXT: [[END_OF_F:^L.*]]:
25 ; X86-LABEL: .section .debug$S,"dr"
29 ; X86-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]]
30 ; X86-NEXT: [[F1_START]]:
31 ; X86-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]]
32 ; X86-NEXT: [[PROC_SEGMENT_START]]:
33 ; X86-NEXT: .short 4423
35 ; X86-NEXT: .long [[END_OF_F]]-_f
37 ; X86-NEXT: .secrel32 _f
38 ; X86-NEXT: .secidx _f
42 ; X86-NEXT: [[PROC_SEGMENT_END]]:
44 ; X86-NEXT: .short 4431
45 ; X86-NEXT: [[F1_END]]:
50 ; X86-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
51 ; X86-NEXT: [[F2_START]]:
52 ; X86-NEXT: .secrel32 _f
53 ; X86-NEXT: .secidx _f
55 ; X86-NEXT: .long [[END_OF_F]]-_f
56 ; X86-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
59 ; X86-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
60 ; X86-NEXT: .long [[ASM_LINE]]-_f
62 ; X86-NEXT: .long [[CALL_LINE]]-_f
64 ; X86-NEXT: .long [[RETURN_STMT]]-_f
66 ; X86-NEXT: [[FILE_SEGMENT_END]]:
67 ; X86-NEXT: [[F2_END]]:
68 ; File index to string table offset subsection
77 ; X86-NEXT: .ascii "D:\\asm.c"
83 ; OBJ32: Name: .debug$S (2E 64 65 62 75 67 24 53)
84 ; OBJ32: Characteristics [ (0x42100040)
86 ; OBJ32: Relocations [
87 ; OBJ32-NEXT: 0x2C IMAGE_REL_I386_SECREL _f
88 ; OBJ32-NEXT: 0x30 IMAGE_REL_I386_SECTION _f
89 ; OBJ32-NEXT: 0x44 IMAGE_REL_I386_SECREL _f
90 ; OBJ32-NEXT: 0x48 IMAGE_REL_I386_SECTION _f
93 ; OBJ32-NEXT: Type: 0xF1
96 ; OBJ32-NEXT: DisplayName: f
97 ; OBJ32-NEXT: Section: _f
98 ; OBJ32-NEXT: CodeSize: 0x6
100 ; OBJ32-NEXT: ProcEnd
102 ; OBJ32: FunctionLineTable [
103 ; OBJ32-NEXT: Name: _f
104 ; OBJ32-NEXT: CodeSize: 0x6
105 ; OBJ32-NEXT: FilenameSegment [
106 ; OBJ32-NEXT: Filename: D:\asm.c
107 ; FIXME: An empty __asm stmt creates an extra entry.
108 ; We seem to know that these offsets are the same statically during the
109 ; execution of endModule(). See PR18679 for the details.
110 ; OBJ32-NEXT: +0x0: 4
111 ; OBJ32-NEXT: +0x0: 5
112 ; OBJ32-NEXT: +0x5: 6
118 ; X64-NEXT: .L{{.*}}:{{$}}
119 ; X64-NEXT: [[START:.*]]:{{$}}
121 ; X64: subq $40, %rsp
122 ; X64-NEXT: [[ASM_LINE:.*]]:{{$}}
123 ; X64: [[CALL_LINE:.*]]:{{$}}
125 ; X64-NEXT: [[EPILOG_AND_RET:.*]]:
126 ; X64: addq $40, %rsp
128 ; X64-NEXT: .L{{.*}}:
129 ; X64-NEXT: [[END_OF_F:.*]]:
131 ; X64-LABEL: .section .debug$S,"dr"
134 ; X64-NEXT: .long 241
135 ; X64-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]]
136 ; X64-NEXT: [[F1_START]]:
137 ; X64-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]]
138 ; X64-NEXT: [[PROC_SEGMENT_START]]:
139 ; X64-NEXT: .short 4423
141 ; X64-NEXT: .long [[END_OF_F]]-f
143 ; X64-NEXT: .secrel32 f
144 ; X64-NEXT: .secidx f
146 ; X64-NEXT: .byte 102
148 ; X64-NEXT: [[PROC_SEGMENT_END]]:
150 ; X64-NEXT: .short 4431
151 ; X64-NEXT: [[F1_END]]:
155 ; X64-NEXT: .long 242
156 ; X64-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
157 ; X64-NEXT: [[F2_START]]:
158 ; X64-NEXT: .secrel32 f
159 ; X64-NEXT: .secidx f
161 ; X64-NEXT: .long [[END_OF_F]]-f
162 ; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
165 ; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
166 ; X64-NEXT: .long [[START]]-f
168 ; X64-NEXT: .long [[ASM_LINE]]-f
170 ; X64-NEXT: .long [[CALL_LINE]]-f
172 ; X64-NEXT: .long [[EPILOG_AND_RET]]-f
174 ; X64-NEXT: [[FILE_SEGMENT_END]]:
175 ; X64-NEXT: [[F2_END]]:
176 ; File index to string table offset subsection
177 ; X64-NEXT: .long 244
182 ; X64-NEXT: .long 243
185 ; X64-NEXT: .ascii "D:\\asm.c"
191 ; OBJ64: Name: .debug$S (2E 64 65 62 75 67 24 53)
192 ; OBJ64: Characteristics [ (0x42100040)
194 ; OBJ64: Relocations [
195 ; OBJ64-NEXT: 0x2C IMAGE_REL_AMD64_SECREL f
196 ; OBJ64-NEXT: 0x30 IMAGE_REL_AMD64_SECTION f
197 ; OBJ64-NEXT: 0x44 IMAGE_REL_AMD64_SECREL f
198 ; OBJ64-NEXT: 0x48 IMAGE_REL_AMD64_SECTION f
200 ; OBJ64: Subsection [
201 ; OBJ64-NEXT: Type: 0xF1
204 ; OBJ64-NEXT: DisplayName: f
205 ; OBJ64-NEXT: Section: f
206 ; OBJ64-NEXT: CodeSize: 0xE
208 ; OBJ64-NEXT: ProcEnd
210 ; OBJ64: FunctionLineTable [
211 ; OBJ64-NEXT: Name: f
212 ; OBJ64-NEXT: CodeSize: 0xE
213 ; OBJ64-NEXT: FilenameSegment [
214 ; OBJ64-NEXT: Filename: D:\asm.c
215 ; OBJ64-NEXT: +0x0: 3
216 ; FIXME: An empty __asm stmt creates an extra entry.
217 ; See PR18679 for the details.
218 ; OBJ64-NEXT: +0x4: 4
219 ; OBJ64-NEXT: +0x4: 5
220 ; OBJ64-NEXT: +0x9: 6
225 ; Function Attrs: nounwind
226 define void @f() #0 {
228 call void asm sideeffect inteldialect ".align 4", "~{dirflag},~{fpsr},~{flags}"() #2, !dbg !12
229 call void @g(), !dbg !13
235 attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
236 attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
237 attributes #2 = { nounwind }
240 !llvm.module.flags = !{!9, !10}
243 !0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
244 !1 = !MDFile(filename: "<unknown>", directory: "D:\5C")
247 !4 = !MDSubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, function: void ()* @f, variables: !2)
248 !5 = !MDFile(filename: "asm.c", directory: "D:\5C")
249 !6 = !MDFile(filename: "asm.c", directory: "D:C")
250 !7 = !MDSubroutineType(types: !8)
252 !9 = !{i32 2, !"Dwarf Version", i32 4}
253 !10 = !{i32 1, !"Debug Info Version", i32 3}
254 !11 = !{!"clang version 3.5 "}
255 !12 = !MDLocation(line: 4, scope: !4)
256 !13 = !MDLocation(line: 5, scope: !4)
257 !14 = !MDLocation(line: 6, scope: !4)