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 5 6; This LL file was generated by running clang on the following code: 7; D:\test.c: 8; 1 void g(void); 9; 2 10; 3 void f(void) { 11; 4 g(); 12; 5 } 13 14; X86-LABEL: _f: 15; X86: # BB 16; X86-NEXT: [[CALL_LINE:^L.*]]:{{$}} 17; X86: calll _g 18; X86-NEXT: [[RETURN_STMT:.*]]: 19; X86: ret 20; X86-NEXT: [[END_OF_F:.*]]: 21; 22; X86-LABEL: .section .debug$S,"dr" 23; X86-NEXT: .long 4 24; Symbol subsection 25; X86-NEXT: .long 241 26; X86-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]] 27; X86-NEXT: [[F1_START]]: 28; X86-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]] 29; X86-NEXT: [[PROC_SEGMENT_START]]: 30; X86-NEXT: .short 4423 31; X86-NEXT: .zero 12 32; X86-NEXT: .long [[END_OF_F]]-_f 33; X86-NEXT: .zero 12 34; X86-NEXT: .secrel32 _f 35; X86-NEXT: .secidx _f 36; X86-NEXT: .byte 0 37; X86-NEXT: .byte 102 38; X86-NEXT: .byte 0 39; X86-NEXT: [[PROC_SEGMENT_END]]: 40; X86-NEXT: .short 2 41; X86-NEXT: .short 4431 42; X86-NEXT: [[F1_END]]: 43; Padding 44; X86-NEXT: .zero 3 45; Line table 46; X86-NEXT: .long 242 47; X86-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]] 48; X86-NEXT: [[F2_START]]: 49; X86-NEXT: .secrel32 _f 50; X86-NEXT: .secidx _f 51; X86-NEXT: .short 1 52; X86-NEXT: .long [[END_OF_F]]-_f 53; X86-NEXT: [[FILE_SEGMENT_START:[^:]*]]: 54; X86-NEXT: .long 0 55; X86-NEXT: .long 2 56; X86-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]] 57; X86-NEXT: .long [[CALL_LINE]]-_f 58; X86-NEXT: .long 4 59; X86-NEXT: .long [[RETURN_STMT]]-_f 60; X86-NEXT: .long 5 61; X86-NEXT: .short 0 62; X86-NEXT: .short 0 63; X86-NEXT: .short 0 64; X86-NEXT: .short 0 65; X86-NEXT: [[FILE_SEGMENT_END]]: 66; X86-NEXT: [[F2_END]]: 67; File index to string table offset subsection 68; X86-NEXT: .long 244 69; X86-NEXT: .long 8 70; X86-NEXT: .long 1 71; X86-NEXT: .long 0 72; String table 73; X86-NEXT: .long 243 74; X86-NEXT: .long 11 75; X86-NEXT: .byte 0 76; X86-NEXT: .ascii "D:\\test.c" 77; X86-NEXT: .byte 0 78; Padding 79; X86-NEXT: .zero 1 80 81; OBJ32: Section { 82; OBJ32: Name: .debug$S (2E 64 65 62 75 67 24 53) 83; OBJ32: Characteristics [ (0x42100040) 84; OBJ32: ] 85; OBJ32: Relocations [ 86; OBJ32-NEXT: 0x2C IMAGE_REL_I386_SECREL _f 87; OBJ32-NEXT: 0x30 IMAGE_REL_I386_SECTION _f 88; OBJ32-NEXT: 0x44 IMAGE_REL_I386_SECREL _f 89; OBJ32-NEXT: 0x48 IMAGE_REL_I386_SECTION _f 90; OBJ32-NEXT: ] 91; OBJ32: Subsection [ 92; OBJ32-NEXT: Type: 0xF1 93; OBJ32-NOT: ] 94; OBJ32: ProcStart { 95; OBJ32-NEXT: DisplayName: f 96; OBJ32-NEXT: Section: _f 97; OBJ32-NEXT: CodeSize: 0x6 98; OBJ32-NEXT: } 99; OBJ32-NEXT: ProcEnd 100; OBJ32-NEXT: ] 101; OBJ32: FunctionLineTable [ 102; OBJ32-NEXT: Name: _f 103; OBJ32-NEXT: Flags: 0x1 104; OBJ32-NEXT: CodeSize: 0x6 105; OBJ32-NEXT: FilenameSegment [ 106; OBJ32-NEXT: Filename: D:\test.c 107; OBJ32-NEXT: +0x0: 4 108; OBJ32-NEXT: +0x5: 5 109; OBJ32-NEXT: ColStart: 0 110; OBJ32-NEXT: ColEnd: 0 111; OBJ32-NEXT: ColStart: 0 112; OBJ32-NEXT: ColEnd: 0 113; OBJ32-NEXT: ] 114; OBJ32-NEXT: ] 115 116; X64-LABEL: f: 117; X64-NEXT: .L{{.*}}:{{$}} 118; X64-NEXT: [[START:.*]]:{{$}} 119; X64: # BB 120; X64: subq $40, %rsp 121; X64-NEXT: [[CALL_LINE:.*]]:{{$}} 122; X64-NEXT: callq g 123; X64-NEXT: [[EPILOG_AND_RET:.*]]: 124; X64: addq $40, %rsp 125; X64-NEXT: ret 126; X64-NEXT: [[END_OF_F:.*]]: 127; 128; X64-LABEL: .section .debug$S,"dr" 129; X64-NEXT: .long 4 130; Symbol subsection 131; X64-NEXT: .long 241 132; X64-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]] 133; X64-NEXT: [[F1_START]]: 134; X64-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]] 135; X64-NEXT: [[PROC_SEGMENT_START]]: 136; X64-NEXT: .short 4423 137; X64-NEXT: .zero 12 138; X64-NEXT: .long [[END_OF_F]]-f 139; X64-NEXT: .zero 12 140; X64-NEXT: .secrel32 f 141; X64-NEXT: .secidx f 142; X64-NEXT: .byte 0 143; X64-NEXT: .byte 102 144; X64-NEXT: .byte 0 145; X64-NEXT: [[PROC_SEGMENT_END]]: 146; X64-NEXT: .short 2 147; X64-NEXT: .short 4431 148; X64-NEXT: [[F1_END]]: 149; Padding 150; X64-NEXT: .zero 3 151; Line table 152; X64-NEXT: .long 242 153; X64-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]] 154; X64-NEXT: [[F2_START]]: 155; X64-NEXT: .secrel32 f 156; X64-NEXT: .secidx f 157; X64-NEXT: .short 1 158; X64-NEXT: .long [[END_OF_F]]-f 159; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]: 160; X64-NEXT: .long 0 161; X64-NEXT: .long 3 162; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]] 163; X64-NEXT: .long [[START]]-f 164; X64-NEXT: .long 3 165; X64-NEXT: .long [[CALL_LINE]]-f 166; X64-NEXT: .long 4 167; X64-NEXT: .long [[EPILOG_AND_RET]]-f 168; X64-NEXT: .long 5 169; X64-NEXT: .short 0 170; X64-NEXT: .short 0 171; X64-NEXT: .short 0 172; X64-NEXT: .short 0 173; X64-NEXT: .short 0 174; X64-NEXT: .short 0 175; X64-NEXT: [[FILE_SEGMENT_END]]: 176; X64-NEXT: [[F2_END]]: 177; File index to string table offset subsection 178; X64-NEXT: .long 244 179; X64-NEXT: .long 8 180; X64-NEXT: .long 1 181; X64-NEXT: .long 0 182; String table 183; X64-NEXT: .long 243 184; X64-NEXT: .long 11 185; X64-NEXT: .byte 0 186; X64-NEXT: .ascii "D:\\test.c" 187; X64-NEXT: .byte 0 188; Padding 189; X64-NEXT: .zero 1 190 191; OBJ64: Section { 192; OBJ64: Name: .debug$S (2E 64 65 62 75 67 24 53) 193; OBJ64: Characteristics [ (0x42100040) 194; OBJ64: ] 195; OBJ64: Relocations [ 196; OBJ64-NEXT: 0x2C IMAGE_REL_AMD64_SECREL f 197; OBJ64-NEXT: 0x30 IMAGE_REL_AMD64_SECTION f 198; OBJ64-NEXT: 0x44 IMAGE_REL_AMD64_SECREL f 199; OBJ64-NEXT: 0x48 IMAGE_REL_AMD64_SECTION f 200; OBJ64-NEXT: ] 201; OBJ64: Subsection [ 202; OBJ64-NEXT: Type: 0xF1 203; OBJ64-NOT: ] 204; OBJ64: ProcStart { 205; OBJ64-NEXT: DisplayName: f 206; OBJ64-NEXT: Section: f 207; OBJ64-NEXT: CodeSize: 0xE 208; OBJ64-NEXT: } 209; OBJ64-NEXT: ProcEnd 210; OBJ64-NEXT: ] 211; OBJ64: FunctionLineTable [ 212; OBJ64-NEXT: Name: f 213; OBJ64-NEXT: Flags: 0x1 214; OBJ64-NEXT: CodeSize: 0xE 215; OBJ64-NEXT: FilenameSegment [ 216; OBJ64-NEXT: Filename: D:\test.c 217; OBJ64-NEXT: +0x0: 3 218; OBJ64-NEXT: +0x4: 4 219; OBJ64-NEXT: +0x9: 5 220; OBJ64-NEXT: ColStart: 0 221; OBJ64-NEXT: ColEnd: 0 222; OBJ64-NEXT: ColStart: 0 223; OBJ64-NEXT: ColEnd: 0 224; OBJ64-NEXT: ColStart: 0 225; OBJ64-NEXT: ColEnd: 0 226; OBJ64-NEXT: ] 227; OBJ64-NEXT: ] 228 229; Function Attrs: nounwind 230define void @f() #0 !dbg !4 { 231entry: 232 call void @g(), !dbg !12 233 ret void, !dbg !13 234} 235 236declare void @g() #1 237 238attributes #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" } 239attributes #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" } 240 241!llvm.dbg.cu = !{!0} 242!llvm.module.flags = !{!9, !10} 243!llvm.ident = !{!11} 244 245!0 = distinct !DICompileUnit(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) 246!1 = !DIFile(filename: "<unknown>", directory: "D:\5C") 247!2 = !{} 248!3 = !{!4} 249!4 = distinct !DISubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !2) 250!5 = !DIFile(filename: "test.c", directory: "D:\5C") 251!6 = !DIFile(filename: "test.c", directory: "D:C") 252!7 = !DISubroutineType(types: !8) 253!8 = !{null} 254!9 = !{i32 2, !"CodeView", i32 1} 255!10 = !{i32 1, !"Debug Info Version", i32 3} 256!11 = !{!"clang version 3.5 "} 257!12 = !DILocation(line: 4, scope: !4) 258!13 = !DILocation(line: 5, scope: !4) 259