• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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-linetables | 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-linetables | FileCheck --check-prefix=OBJ64 %s
5
6; This LL file was generated by running clang on the following code:
7; D:\asm.c:
8;  1 void g(void);
9;  2
10;  3 void f(void) {
11;  4   __asm align 4;
12;  5   g();
13;  6 }
14
15; X86-LABEL: _f:
16; X86-NEXT: # BB
17; X86-NEXT: [[ASM_LINE:^L.*]]:{{$}}
18; X86:      [[CALL_LINE:^L.*]]:{{$}}
19; X86-NEXT: calll   _g
20; X86-NEXT: [[RETURN_STMT:.*]]:
21; X86-NEXT: ret
22; X86-NEXT: [[END_OF_F:.*]]:
23;
24; X86-LABEL: .section        .debug$S,"rnd"
25; X86-NEXT: .long   4
26; X86-NEXT: .long   242
27; X86-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
28; X86-NEXT: [[F2_START]]:
29; X86-NEXT: .secrel32 _f
30; X86-NEXT: .secidx _f
31; X86-NEXT: .long [[END_OF_F]]-_f
32; X86-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
33; X86-NEXT: .long   0
34; X86-NEXT: .long   3
35; X86-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
36; X86-NEXT: .long [[ASM_LINE]]-_f
37; X86-NEXT: .long   4
38; X86-NEXT: .long [[CALL_LINE]]-_f
39; X86-NEXT: .long   5
40; X86-NEXT: .long [[RETURN_STMT]]-_f
41; X86-NEXT: .long   6
42; X86-NEXT: [[FILE_SEGMENT_END]]:
43; X86-NEXT: [[F2_END]]:
44; File index to string table offset subsection
45; X86-NEXT: .long   244
46; X86-NEXT: .long   8
47; X86-NEXT: .long   1
48; X86-NEXT: .long   0
49; String table
50; X86-NEXT: .long   243
51; X86-NEXT: .long   10
52; X86-NEXT: .byte   0
53; X86-NEXT: .ascii  "D:\\asm.c"
54; X86-NEXT: .byte   0
55; Padding
56; X86-NEXT: .zero   2
57
58; OBJ32:    Section {
59; OBJ32:      Name: .debug$S (2E 64 65 62 75 67 24 53)
60; OBJ32:      Characteristics [ (0x42100040)
61; OBJ32:      ]
62; OBJ32:      Relocations [
63; OBJ32-NEXT:   0xC IMAGE_REL_I386_SECREL _f
64; OBJ32-NEXT:   0x10 IMAGE_REL_I386_SECTION _f
65; OBJ32-NEXT: ]
66; OBJ32:      FunctionLineTable [
67; OBJ32-NEXT:   Name: _f
68; OBJ32-NEXT:   CodeSize: 0x6
69; OBJ32-NEXT:   FilenameSegment [
70; OBJ32-NEXT:     Filename: D:\asm.c
71; FIXME: An empty __asm stmt creates an extra entry.
72; We seem to know that these offsets are the same statically during the
73; execution of endModule().  See PR18679 for the details.
74; OBJ32-NEXT:     +0x0: 4
75; OBJ32-NEXT:     +0x0: 5
76; OBJ32-NEXT:     +0x5: 6
77; OBJ32-NEXT:   ]
78; OBJ32-NEXT: ]
79; OBJ32:    }
80
81; X64-LABEL: f:
82; X64-NEXT: [[START:.*]]:{{$}}
83; X64-NEXT: # BB
84; X64-NEXT: subq    $40, %rsp
85; X64-NEXT: [[ASM_LINE:.*]]:{{$}}
86; X64:      [[CALL_LINE:.*]]:{{$}}
87; X64-NEXT: callq   g
88; X64-NEXT: [[EPILOG_AND_RET:.*]]:
89; X64-NEXT: addq    $40, %rsp
90; X64-NEXT: ret
91; X64-NEXT: [[END_OF_F:.*]]:
92;
93; X64-LABEL: .section        .debug$S,"rnd"
94; X64-NEXT: .long   4
95; X64-NEXT: .long   242
96; X64-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
97; X64-NEXT: [[F2_START]]:
98; X64-NEXT: .secrel32 f
99; X64-NEXT: .secidx f
100; X64-NEXT: .long [[END_OF_F]]-f
101; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
102; X64-NEXT: .long   0
103; X64-NEXT: .long   4
104; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
105; X64-NEXT: .long [[START]]-f
106; X64-NEXT: .long   3
107; X64-NEXT: .long [[ASM_LINE]]-f
108; X64-NEXT: .long   4
109; X64-NEXT: .long [[CALL_LINE]]-f
110; X64-NEXT: .long   5
111; X64-NEXT: .long [[EPILOG_AND_RET]]-f
112; X64-NEXT: .long   6
113; X64-NEXT: [[FILE_SEGMENT_END]]:
114; X64-NEXT: [[F2_END]]:
115; File index to string table offset subsection
116; X64-NEXT: .long   244
117; X64-NEXT: .long   8
118; X64-NEXT: .long   1
119; X64-NEXT: .long   0
120; String table
121; X64-NEXT: .long   243
122; X64-NEXT: .long   10
123; X64-NEXT: .byte   0
124; X64-NEXT: .ascii  "D:\\asm.c"
125; X64-NEXT: .byte   0
126; Padding
127; X64-NEXT: .zero   2
128
129; OBJ64:    Section {
130; OBJ64:      Name: .debug$S (2E 64 65 62 75 67 24 53)
131; OBJ64:      Characteristics [ (0x42100040)
132; OBJ64:      ]
133; OBJ64:      Relocations [
134; OBJ64-NEXT:   0xC IMAGE_REL_AMD64_SECREL f
135; OBJ64-NEXT:   0x10 IMAGE_REL_AMD64_SECTION f
136; OBJ64-NEXT: ]
137; OBJ64:      FunctionLineTable [
138; OBJ64-NEXT:   Name: f
139; OBJ64-NEXT:   CodeSize: 0xE
140; OBJ64-NEXT:   FilenameSegment [
141; OBJ64-NEXT:     Filename: D:\asm.c
142; OBJ64-NEXT:     +0x0: 3
143; FIXME: An empty __asm stmt creates an extra entry.
144; See PR18679 for the details.
145; OBJ64-NEXT:     +0x4: 4
146; OBJ64-NEXT:     +0x4: 5
147; OBJ64-NEXT:     +0x9: 6
148; OBJ64-NEXT:   ]
149; OBJ64-NEXT: ]
150; OBJ64:    }
151
152; Function Attrs: nounwind
153define void @f() #0 {
154entry:
155  call void asm sideeffect inteldialect ".align 4", "~{dirflag},~{fpsr},~{flags}"() #2, !dbg !12
156  call void @g(), !dbg !13
157  ret void, !dbg !14
158}
159
160declare void @g() #1
161
162attributes #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" }
163attributes #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" }
164attributes #2 = { nounwind }
165
166!llvm.dbg.cu = !{!0}
167!llvm.module.flags = !{!9, !10}
168!llvm.ident = !{!11}
169
170!0 = metadata !{i32 786449, metadata !1, i32 12, metadata !"clang version 3.5 ", i1 false, metadata !"", i32 0, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [D:\/<unknown>] [DW_LANG_C99]
171!1 = metadata !{metadata !"<unknown>", metadata !"D:\5C"}
172!2 = metadata !{i32 0}
173!3 = metadata !{metadata !4}
174!4 = metadata !{i32 786478, metadata !5, metadata !6, metadata !"f", metadata !"f", metadata !"", i32 3, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @f, null, null, metadata !2, i32 3} ; [ DW_TAG_subprogram ] [line 3] [def] [f]
175!5 = metadata !{metadata !"asm.c", metadata !"D:\5C"}
176!6 = metadata !{i32 786473, metadata !5}          ; [ DW_TAG_file_type ] [D:\/asm.c]
177!7 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !8, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
178!8 = metadata !{null}
179!9 = metadata !{i32 2, metadata !"Dwarf Version", i32 4}
180!10 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}
181!11 = metadata !{metadata !"clang version 3.5 "}
182!12 = metadata !{i32 4, i32 0, metadata !4, null}
183!13 = metadata !{i32 5, i32 0, metadata !4, null}
184!14 = metadata !{i32 6, i32 0, metadata !4, null}
185