2014-01-31 01:53:45 +08:00
; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s
2015-02-19 03:32:05 +08:00
; 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
2014-01-31 01:53:45 +08:00
; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -O0 < %s | FileCheck --check-prefix=X64 %s
2015-02-19 03:32:05 +08:00
; 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
2014-01-30 09:39:17 +08:00
; This LL file was generated by running clang on the following code:
; D:\source.c:
; 1 void z(void);
; 2
; 3 void x(void) {
; 4 z();
; 5 }
; 6
; 7 void y(void) {
; 8 z();
; 9 }
; 10
; 11 void f(void) {
; 12 x();
; 13 y();
; 14 z();
; 15 }
2014-03-26 16:45:02 +08:00
; X86-LABEL: _x:
2014-11-04 16:03:31 +08:00
; X86: # BB
2014-01-30 09:39:17 +08:00
; X86-NEXT: [[X_CALL:.*]]:{{$}}
2014-11-04 16:03:31 +08:00
; X86: calll _z
2014-01-30 09:39:17 +08:00
; X86-NEXT: [[X_RETURN:.*]]:
2014-11-04 16:03:31 +08:00
; X86: ret
2014-01-30 09:39:17 +08:00
; X86-NEXT: [[END_OF_X:.*]]:
;
2014-03-26 16:45:02 +08:00
; X86-LABEL: _y:
2014-11-04 16:03:31 +08:00
; X86: # BB
2014-01-30 09:39:17 +08:00
; X86-NEXT: [[Y_CALL:.*]]:{{$}}
2014-11-04 16:03:31 +08:00
; X86: calll _z
2014-01-30 09:39:17 +08:00
; X86-NEXT: [[Y_RETURN:.*]]:
2014-11-04 16:03:31 +08:00
; X86: ret
2014-01-30 09:39:17 +08:00
; X86-NEXT: [[END_OF_Y:.*]]:
;
2014-03-26 16:45:02 +08:00
; X86-LABEL: _f:
2014-11-04 16:03:31 +08:00
; X86: # BB
2014-01-30 09:39:17 +08:00
; X86-NEXT: [[F_CALLS_X:.*]]:{{$}}
2014-11-04 16:03:31 +08:00
; X86: calll _x
2014-01-30 09:39:17 +08:00
; X86-NEXT: [[F_CALLS_Y:.*]]:
2014-11-04 16:03:31 +08:00
; X86: calll _y
2014-01-30 09:39:17 +08:00
; X86-NEXT: [[F_CALLS_Z:.*]]:
2014-11-04 16:03:31 +08:00
; X86: calll _z
2014-01-30 09:39:17 +08:00
; X86-NEXT: [[F_RETURN:.*]]:
2014-11-04 16:03:31 +08:00
; X86: ret
2014-01-30 09:39:17 +08:00
; X86-NEXT: [[END_OF_F:.*]]:
;
2015-02-07 16:26:40 +08:00
; X86-LABEL: .section .debug$S,"dr"
2014-01-30 09:39:17 +08:00
; X86-NEXT: .long 4
2014-10-24 09:27:45 +08:00
; Symbol subsection for x
; X86-NEXT: .long 241
; X86-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]]
; X86-NEXT: [[F1_START]]:
; X86-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]]
; X86-NEXT: [[PROC_SEGMENT_START]]:
; X86-NEXT: .short 4423
; X86-NEXT: .zero 12
; X86-NEXT: .long [[END_OF_X]]-_x
; X86-NEXT: .zero 12
; X86-NEXT: .secrel32 _x
; X86-NEXT: .secidx _x
; X86-NEXT: .byte 0
; X86-NEXT: .byte 120
; X86-NEXT: .byte 0
; X86-NEXT: [[PROC_SEGMENT_END]]:
; X86-NEXT: .short 2
; X86-NEXT: .short 4431
; X86-NEXT: [[F1_END]]:
; Padding
; X86-NEXT: .zero 3
2014-01-30 09:39:17 +08:00
; Line table subsection for x
; X86-NEXT: .long 242
; X86-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
; X86-NEXT: [[F2_START]]:
; X86-NEXT: .secrel32 _x
; X86-NEXT: .secidx _x
2015-07-09 08:19:51 +08:00
; X86-NEXT: .short 1
2014-01-30 09:39:17 +08:00
; X86-NEXT: .long [[END_OF_X]]-_x
; X86-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
; X86-NEXT: .long 0
; X86-NEXT: .long 2
; X86-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
; X86-NEXT: .long [[X_CALL]]-_x
; X86-NEXT: .long 4
; X86-NEXT: .long [[X_RETURN]]-_x
; X86-NEXT: .long 5
2015-07-09 08:19:51 +08:00
; X86-NEXT: .short 42
2016-01-13 05:58:20 +08:00
; X86-NEXT: .short 0
2015-07-09 08:19:51 +08:00
; X86-NEXT: .short 43
2016-01-13 05:58:20 +08:00
; X86-NEXT: .short 0
2014-01-30 09:39:17 +08:00
; X86-NEXT: [[FILE_SEGMENT_END]]:
; X86-NEXT: [[F2_END]]:
2014-10-24 09:27:45 +08:00
; Symbol subsection for y
; X86-NEXT: .long 241
; X86-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]]
; X86-NEXT: [[F1_START]]:
; X86-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]]
; X86-NEXT: [[PROC_SEGMENT_START]]:
; X86-NEXT: .short 4423
; X86-NEXT: .zero 12
; X86-NEXT: .long [[END_OF_Y]]-_y
; X86-NEXT: .zero 12
; X86-NEXT: .secrel32 _y
; X86-NEXT: .secidx _y
; X86-NEXT: .byte 0
; X86-NEXT: .byte 121
; X86-NEXT: .byte 0
; X86-NEXT: [[PROC_SEGMENT_END]]:
; X86-NEXT: .short 2
; X86-NEXT: .short 4431
; X86-NEXT: [[F1_END]]:
; Padding
; X86-NEXT: .zero 3
2014-01-30 09:39:17 +08:00
; Line table subsection for y
; X86-NEXT: .long 242
; X86-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
; X86-NEXT: [[F2_START]]:
; X86-NEXT: .secrel32 _y
; X86-NEXT: .secidx _y
2015-07-09 08:19:51 +08:00
; X86-NEXT: .short 1
2014-01-30 09:39:17 +08:00
; X86-NEXT: .long [[END_OF_Y]]-_y
; X86-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
; X86-NEXT: .long 0
; X86-NEXT: .long 2
; X86-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
; X86-NEXT: .long [[Y_CALL]]-_y
; X86-NEXT: .long 8
; X86-NEXT: .long [[Y_RETURN]]-_y
; X86-NEXT: .long 9
2015-07-09 08:19:51 +08:00
; X86-NEXT: .short 52
2016-01-13 05:58:20 +08:00
; X86-NEXT: .short 0
2015-07-09 08:19:51 +08:00
; X86-NEXT: .short 53
2016-01-13 05:58:20 +08:00
; X86-NEXT: .short 0
2014-01-30 09:39:17 +08:00
; X86-NEXT: [[FILE_SEGMENT_END]]:
; X86-NEXT: [[F2_END]]:
2014-10-24 09:27:45 +08:00
; Symbol subsection for f
; X86-NEXT: .long 241
; X86-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]]
; X86-NEXT: [[F1_START]]:
; X86-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]]
; X86-NEXT: [[PROC_SEGMENT_START]]:
; X86-NEXT: .short 4423
; X86-NEXT: .zero 12
; X86-NEXT: .long [[END_OF_F]]-_f
; X86-NEXT: .zero 12
; X86-NEXT: .secrel32 _f
; X86-NEXT: .secidx _f
; X86-NEXT: .byte 0
; X86-NEXT: .byte 102
; X86-NEXT: .byte 0
; X86-NEXT: [[PROC_SEGMENT_END]]:
; X86-NEXT: .short 2
; X86-NEXT: .short 4431
; X86-NEXT: [[F1_END]]:
; Padding
; X86-NEXT: .zero 3
2014-01-30 09:39:17 +08:00
; Line table subsection for f
; X86-NEXT: .long 242
; X86-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
; X86-NEXT: [[F2_START]]:
; X86-NEXT: .secrel32 _f
; X86-NEXT: .secidx _f
2015-07-09 08:19:51 +08:00
; X86-NEXT: .short 1
2014-01-30 09:39:17 +08:00
; X86-NEXT: .long [[END_OF_F]]-_f
; X86-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
; X86-NEXT: .long 0
; X86-NEXT: .long 4
; X86-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
; X86-NEXT: .long [[F_CALLS_X]]-_f
; X86-NEXT: .long 12
; X86-NEXT: .long [[F_CALLS_Y]]-_f
; X86-NEXT: .long 13
; X86-NEXT: .long [[F_CALLS_Z]]-_f
; X86-NEXT: .long 14
; X86-NEXT: .long [[F_RETURN]]-_f
; X86-NEXT: .long 15
2015-07-09 08:19:51 +08:00
; X86-NEXT: .short 62
2016-01-13 05:58:20 +08:00
; X86-NEXT: .short 0
2015-07-09 08:19:51 +08:00
; X86-NEXT: .short 63
2016-01-13 05:58:20 +08:00
; X86-NEXT: .short 0
2015-07-09 08:19:51 +08:00
; X86-NEXT: .short 72
2016-01-13 05:58:20 +08:00
; X86-NEXT: .short 0
2015-07-09 08:19:51 +08:00
; X86-NEXT: .short 73
2016-01-13 05:58:20 +08:00
; X86-NEXT: .short 0
2014-01-30 09:39:17 +08:00
; X86-NEXT: [[FILE_SEGMENT_END]]:
; X86-NEXT: [[F2_END]]:
; File index to string table offset subsection
; X86-NEXT: .long 244
; X86-NEXT: .long 8
; X86-NEXT: .long 1
; X86-NEXT: .long 0
; String table
; X86-NEXT: .long 243
; X86-NEXT: .long 13
; X86-NEXT: .byte 0
; X86-NEXT: .ascii "D:\\source.c"
; X86-NEXT: .byte 0
; X86-NEXT: .zero 3
; OBJ32: Section {
; OBJ32: Name: .debug$S (2E 64 65 62 75 67 24 53)
; OBJ32: Characteristics [ (0x42100040)
; OBJ32: ]
; OBJ32: Relocations [
2014-10-24 09:27:45 +08:00
; OBJ32-NEXT: 0x2C IMAGE_REL_I386_SECREL _x
; OBJ32-NEXT: 0x30 IMAGE_REL_I386_SECTION _x
; OBJ32-NEXT: 0x44 IMAGE_REL_I386_SECREL _x
; OBJ32-NEXT: 0x48 IMAGE_REL_I386_SECTION _x
2015-07-09 08:19:51 +08:00
; OBJ32-NEXT: 0x9C IMAGE_REL_I386_SECREL _y
; OBJ32-NEXT: 0xA0 IMAGE_REL_I386_SECTION _y
; OBJ32-NEXT: 0xB4 IMAGE_REL_I386_SECREL _y
; OBJ32-NEXT: 0xB8 IMAGE_REL_I386_SECTION _y
; OBJ32-NEXT: 0x10C IMAGE_REL_I386_SECREL _f
; OBJ32-NEXT: 0x110 IMAGE_REL_I386_SECTION _f
; OBJ32-NEXT: 0x124 IMAGE_REL_I386_SECREL _f
; OBJ32-NEXT: 0x128 IMAGE_REL_I386_SECTION _f
2014-10-24 09:27:45 +08:00
; OBJ32-NEXT: ]
; OBJ32: Subsection [
; OBJ32-NEXT: Type: 0xF1
; OBJ32-NOT: ]
; OBJ32: ProcStart {
2014-11-13 04:10:09 +08:00
; OBJ32-NEXT: DisplayName: x
2014-10-24 09:27:45 +08:00
; OBJ32-NEXT: Section: _x
; OBJ32-NEXT: CodeSize: 0x6
; OBJ32-NEXT: }
; OBJ32-NEXT: ProcEnd
2014-01-30 09:39:17 +08:00
; OBJ32-NEXT: ]
2014-10-24 09:27:45 +08:00
; OBJ32: Subsection [
; OBJ32-NEXT: Type: 0xF2
; OBJ32: ]
; OBJ32: Subsection [
; OBJ32-NEXT: Type: 0xF1
; OBJ32-NOT: ]
; OBJ32: ProcStart {
2014-11-13 04:10:09 +08:00
; OBJ32-NEXT: DisplayName: y
2014-10-24 09:27:45 +08:00
; OBJ32-NEXT: Section: _y
; OBJ32-NEXT: CodeSize: 0x6
; OBJ32-NEXT: }
; OBJ32-NEXT: ProcEnd
; OBJ32-NEXT: ]
; OBJ32: Subsection [
; OBJ32-NEXT: Type: 0xF2
; OBJ32: ]
; OBJ32: Subsection [
; OBJ32-NEXT: Type: 0xF1
; OBJ32-NOT: ]
; OBJ32: ProcStart {
2014-11-13 04:10:09 +08:00
; OBJ32-NEXT: DisplayName: f
2014-10-24 09:27:45 +08:00
; OBJ32-NEXT: Section: _f
; OBJ32-NEXT: CodeSize: 0x10
; OBJ32-NEXT: }
; OBJ32-NEXT: ProcEnd
; OBJ32-NEXT: ]
; OBJ32: Subsection [
; OBJ32-NEXT: Type: 0xF2
; OBJ32: ]
2014-01-30 09:39:17 +08:00
; OBJ32: FunctionLineTable [
; OBJ32-NEXT: Name: _x
2015-07-09 08:19:51 +08:00
; OBJ32-NEXT: Flags: 0x1
2014-01-30 09:39:17 +08:00
; OBJ32-NEXT: CodeSize: 0x6
; OBJ32-NEXT: FilenameSegment [
; OBJ32-NEXT: Filename: D:\source.c
; OBJ32-NEXT: +0x0: 4
; OBJ32-NEXT: +0x5: 5
2015-07-09 08:19:51 +08:00
; OBJ32-NEXT: ColStart: 42
2016-01-13 05:58:20 +08:00
; OBJ32-NEXT: ColEnd: 0
2015-07-09 08:19:51 +08:00
; OBJ32-NEXT: ColStart: 43
2016-01-13 05:58:20 +08:00
; OBJ32-NEXT: ColEnd: 0
2014-01-30 09:39:17 +08:00
; OBJ32-NEXT: ]
; OBJ32-NEXT: ]
; OBJ32-NEXT: FunctionLineTable [
; OBJ32-NEXT: Name: _y
2015-07-09 08:19:51 +08:00
; OBJ32-NEXT: Flags: 0x1
2014-01-30 09:39:17 +08:00
; OBJ32-NEXT: CodeSize: 0x6
; OBJ32-NEXT: FilenameSegment [
; OBJ32-NEXT: Filename: D:\source.c
; OBJ32-NEXT: +0x0: 8
; OBJ32-NEXT: +0x5: 9
2015-07-09 08:19:51 +08:00
; OBJ32-NEXT: ColStart: 52
2016-01-13 05:58:20 +08:00
; OBJ32-NEXT: ColEnd: 0
2015-07-09 08:19:51 +08:00
; OBJ32-NEXT: ColStart: 53
2016-01-13 05:58:20 +08:00
; OBJ32-NEXT: ColEnd: 0
2014-01-30 09:39:17 +08:00
; OBJ32-NEXT: ]
; OBJ32-NEXT: ]
; OBJ32-NEXT: FunctionLineTable [
; OBJ32-NEXT: Name: _f
2015-07-09 08:19:51 +08:00
; OBJ32-NEXT: Flags: 0x1
2014-01-30 09:39:17 +08:00
; OBJ32-NEXT: CodeSize: 0x10
; OBJ32-NEXT: FilenameSegment [
; OBJ32-NEXT: Filename: D:\source.c
; OBJ32-NEXT: +0x0: 12
; OBJ32-NEXT: +0x5: 13
; OBJ32-NEXT: +0xA: 14
; OBJ32-NEXT: +0xF: 15
2015-07-09 08:19:51 +08:00
; OBJ32-NEXT: ColStart: 62
2016-01-13 05:58:20 +08:00
; OBJ32-NEXT: ColEnd: 0
2015-07-09 08:19:51 +08:00
; OBJ32-NEXT: ColStart: 63
2016-01-13 05:58:20 +08:00
; OBJ32-NEXT: ColEnd: 0
2015-07-09 08:19:51 +08:00
; OBJ32-NEXT: ColStart: 72
2016-01-13 05:58:20 +08:00
; OBJ32-NEXT: ColEnd: 0
2015-07-09 08:19:51 +08:00
; OBJ32-NEXT: ColStart: 73
2016-01-13 05:58:20 +08:00
; OBJ32-NEXT: ColEnd: 0
2014-01-30 09:39:17 +08:00
; OBJ32-NEXT: ]
; OBJ32-NEXT: ]
2014-03-26 16:45:02 +08:00
; X64-LABEL: x:
2015-03-05 10:05:42 +08:00
; X64-NEXT: .L{{.*}}:
2014-01-30 09:39:17 +08:00
; X64-NEXT: [[X_START:.*]]:{{$}}
2014-11-04 16:03:31 +08:00
; X64: # BB
; X64: subq $40, %rsp
2014-01-30 09:39:17 +08:00
; X64-NEXT: [[X_CALL_LINE:.*]]:{{$}}
; X64-NEXT: callq z
; X64-NEXT: [[X_EPILOG_AND_RET:.*]]:
2014-11-04 16:03:31 +08:00
; X64: addq $40, %rsp
2014-01-30 09:39:17 +08:00
; X64-NEXT: ret
; X64-NEXT: [[END_OF_X:.*]]:
;
2014-03-26 16:45:02 +08:00
; X64-LABEL: y:
2015-03-05 10:05:42 +08:00
; X64-NEXT: .L{{.*}}:
2014-01-30 09:39:17 +08:00
; X64-NEXT: [[Y_START:.*]]:{{$}}
2014-11-04 16:03:31 +08:00
; X64: # BB
; X64: subq $40, %rsp
2014-01-30 09:39:17 +08:00
; X64-NEXT: [[Y_CALL_LINE:.*]]:{{$}}
; X64-NEXT: callq z
; X64-NEXT: [[Y_EPILOG_AND_RET:.*]]:
2014-11-04 16:03:31 +08:00
; X64: addq $40, %rsp
2014-01-30 09:39:17 +08:00
; X64-NEXT: ret
; X64-NEXT: [[END_OF_Y:.*]]:
;
2014-03-26 16:45:02 +08:00
; X64-LABEL: f:
2015-03-05 10:05:42 +08:00
; X64-NEXT: .L{{.*}}:
2014-01-30 09:39:17 +08:00
; X64-NEXT: [[F_START:.*]]:{{$}}
2014-11-04 16:03:31 +08:00
; X64: # BB
; X64: subq $40, %rsp
2014-01-30 09:39:17 +08:00
; X64-NEXT: [[F_CALLS_X:.*]]:{{$}}
; X64-NEXT: callq x
; X64-NEXT: [[F_CALLS_Y:.*]]:
2014-11-04 16:03:31 +08:00
; X64: callq y
2014-01-30 09:39:17 +08:00
; X64-NEXT: [[F_CALLS_Z:.*]]:
2014-11-04 16:03:31 +08:00
; X64: callq z
2014-01-30 09:39:17 +08:00
; X64-NEXT: [[F_EPILOG_AND_RET:.*]]:
2014-11-04 16:03:31 +08:00
; X64: addq $40, %rsp
2014-01-30 09:39:17 +08:00
; X64-NEXT: ret
; X64-NEXT: [[END_OF_F:.*]]:
;
2015-02-07 16:26:40 +08:00
; X64-LABEL: .section .debug$S,"dr"
2014-01-30 09:39:17 +08:00
; X64-NEXT: .long 4
2014-10-24 09:27:45 +08:00
; Symbol subsection for x
; X64-NEXT: .long 241
; X64-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]]
; X64-NEXT: [[F1_START]]:
; X64-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]]
; X64-NEXT: [[PROC_SEGMENT_START]]:
; X64-NEXT: .short 4423
; X64-NEXT: .zero 12
; X64-NEXT: .long [[END_OF_X]]-x
; X64-NEXT: .zero 12
; X64-NEXT: .secrel32 x
; X64-NEXT: .secidx x
; X64-NEXT: .byte 0
; X64-NEXT: .byte 120
; X64-NEXT: .byte 0
; X64-NEXT: [[PROC_SEGMENT_END]]:
; X64-NEXT: .short 2
; X64-NEXT: .short 4431
; X64-NEXT: [[F1_END]]:
; Padding
; X64-NEXT: .zero 3
2014-01-30 09:39:17 +08:00
; Line table subsection for x
; X64-NEXT: .long 242
; X64-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
; X64-NEXT: [[F2_START]]:
; X64-NEXT: .secrel32 x
; X64-NEXT: .secidx x
2015-07-09 08:19:51 +08:00
; X64-NEXT: .short 1
2014-01-30 09:39:17 +08:00
; X64-NEXT: .long [[END_OF_X]]-x
; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
; X64-NEXT: .long 0
; X64-NEXT: .long 3
; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
; X64-NEXT: .long [[X_START]]-x
; X64-NEXT: .long 3
; X64-NEXT: .long [[X_CALL_LINE]]-x
; X64-NEXT: .long 4
; X64-NEXT: .long [[X_EPILOG_AND_RET]]-x
; X64-NEXT: .long 5
2015-07-09 08:19:51 +08:00
; X64-NEXT: .short 0
; X64-NEXT: .short 0
; X64-NEXT: .short 42
2016-01-13 05:58:20 +08:00
; X64-NEXT: .short 0
2015-07-09 08:19:51 +08:00
; X64-NEXT: .short 43
2016-01-13 05:58:20 +08:00
; X64-NEXT: .short 0
2014-01-30 09:39:17 +08:00
; X64-NEXT: [[FILE_SEGMENT_END]]:
; X64-NEXT: [[F2_END]]:
2014-10-24 09:27:45 +08:00
; Symbol subsection for y
; X64-NEXT: .long 241
; X64-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]]
; X64-NEXT: [[F1_START]]:
; X64-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]]
; X64-NEXT: [[PROC_SEGMENT_START]]:
; X64-NEXT: .short 4423
; X64-NEXT: .zero 12
; X64-NEXT: .long [[END_OF_Y]]-y
; X64-NEXT: .zero 12
; X64-NEXT: .secrel32 y
; X64-NEXT: .secidx y
; X64-NEXT: .byte 0
; X64-NEXT: .byte 121
; X64-NEXT: .byte 0
; X64-NEXT: [[PROC_SEGMENT_END]]:
; X64-NEXT: .short 2
; X64-NEXT: .short 4431
; X64-NEXT: [[F1_END]]:
; Padding
; X64-NEXT: .zero 3
2014-01-30 09:39:17 +08:00
; Line table subsection for y
; X64-NEXT: .long 242
; X64-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
; X64-NEXT: [[F2_START]]:
; X64-NEXT: .secrel32 y
; X64-NEXT: .secidx y
2015-07-09 08:19:51 +08:00
; X64-NEXT: .short 1
2014-01-30 09:39:17 +08:00
; X64-NEXT: .long [[END_OF_Y]]-y
; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
; X64-NEXT: .long 0
; X64-NEXT: .long 3
; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
; X64-NEXT: .long [[Y_START]]-y
; X64-NEXT: .long 7
; X64-NEXT: .long [[Y_CALL_LINE]]-y
; X64-NEXT: .long 8
; X64-NEXT: .long [[Y_EPILOG_AND_RET]]-y
; X64-NEXT: .long 9
2015-07-09 08:19:51 +08:00
; X64-NEXT: .short 0
; X64-NEXT: .short 0
; X64-NEXT: .short 52
2016-01-13 05:58:20 +08:00
; X64-NEXT: .short 0
2015-07-09 08:19:51 +08:00
; X64-NEXT: .short 53
2016-01-13 05:58:20 +08:00
; X64-NEXT: .short 0
2014-01-30 09:39:17 +08:00
; X64-NEXT: [[FILE_SEGMENT_END]]:
; X64-NEXT: [[F2_END]]:
2014-10-24 09:27:45 +08:00
; Symbol subsection for f
; X64-NEXT: .long 241
; X64-NEXT: .long [[F1_END:.*]]-[[F1_START:.*]]
; X64-NEXT: [[F1_START]]:
; X64-NEXT: .short [[PROC_SEGMENT_END:.*]]-[[PROC_SEGMENT_START:.*]]
; X64-NEXT: [[PROC_SEGMENT_START]]:
; X64-NEXT: .short 4423
; X64-NEXT: .zero 12
; X64-NEXT: .long [[END_OF_F]]-f
; X64-NEXT: .zero 12
; X64-NEXT: .secrel32 f
; X64-NEXT: .secidx f
; X64-NEXT: .byte 0
; X64-NEXT: .byte 102
; X64-NEXT: .byte 0
; X64-NEXT: [[PROC_SEGMENT_END]]:
; X64-NEXT: .short 2
; X64-NEXT: .short 4431
; X64-NEXT: [[F1_END]]:
; Padding
; X64-NEXT: .zero 3
2014-01-30 09:39:17 +08:00
; Line table subsection for f
; X64-NEXT: .long 242
; X64-NEXT: .long [[F2_END:.*]]-[[F2_START:.*]]
; X64-NEXT: [[F2_START]]:
; X64-NEXT: .secrel32 f
; X64-NEXT: .secidx f
2015-07-09 08:19:51 +08:00
; X64-NEXT: .short 1
2014-01-30 09:39:17 +08:00
; X64-NEXT: .long [[END_OF_F]]-f
; X64-NEXT: [[FILE_SEGMENT_START:[^:]*]]:
; X64-NEXT: .long 0
; X64-NEXT: .long 5
; X64-NEXT: .long [[FILE_SEGMENT_END:.*]]-[[FILE_SEGMENT_START]]
; X64-NEXT: .long [[F_START]]-f
; X64-NEXT: .long 11
; X64-NEXT: .long [[F_CALLS_X]]-f
; X64-NEXT: .long 12
; X64-NEXT: .long [[F_CALLS_Y]]-f
; X64-NEXT: .long 13
; X64-NEXT: .long [[F_CALLS_Z]]-f
; X64-NEXT: .long 14
; X64-NEXT: .long [[F_EPILOG_AND_RET]]-f
; X64-NEXT: .long 15
2015-07-09 08:19:51 +08:00
; X64-NEXT: .short 0
; X64-NEXT: .short 0
; X64-NEXT: .short 62
2016-01-13 05:58:20 +08:00
; X64-NEXT: .short 0
2015-07-09 08:19:51 +08:00
; X64-NEXT: .short 63
2016-01-13 05:58:20 +08:00
; X64-NEXT: .short 0
2015-07-09 08:19:51 +08:00
; X64-NEXT: .short 72
2016-01-13 05:58:20 +08:00
; X64-NEXT: .short 0
2015-07-09 08:19:51 +08:00
; X64-NEXT: .short 73
2016-01-13 05:58:20 +08:00
; X64-NEXT: .short 0
2014-01-30 09:39:17 +08:00
; X64-NEXT: [[FILE_SEGMENT_END]]:
; X64-NEXT: [[F2_END]]:
; File index to string table offset subsection
; X64-NEXT: .long 244
; X64-NEXT: .long 8
; X64-NEXT: .long 1
; X64-NEXT: .long 0
; String table
; X64-NEXT: .long 243
; X64-NEXT: .long 13
; X64-NEXT: .byte 0
; X64-NEXT: .ascii "D:\\source.c"
; X64-NEXT: .byte 0
; X64-NEXT: .zero 3
; OBJ64: Section {
; OBJ64: Name: .debug$S (2E 64 65 62 75 67 24 53)
; OBJ64: Characteristics [ (0x42100040)
; OBJ64: ]
; OBJ64: Relocations [
2014-10-24 09:27:45 +08:00
; OBJ64-NEXT: 0x2C IMAGE_REL_AMD64_SECREL x
; OBJ64-NEXT: 0x30 IMAGE_REL_AMD64_SECTION x
; OBJ64-NEXT: 0x44 IMAGE_REL_AMD64_SECREL x
; OBJ64-NEXT: 0x48 IMAGE_REL_AMD64_SECTION x
2015-07-09 08:19:51 +08:00
; OBJ64-NEXT: 0xA8 IMAGE_REL_AMD64_SECREL y
; OBJ64-NEXT: 0xAC IMAGE_REL_AMD64_SECTION y
; OBJ64-NEXT: 0xC0 IMAGE_REL_AMD64_SECREL y
; OBJ64-NEXT: 0xC4 IMAGE_REL_AMD64_SECTION y
2014-10-24 09:27:45 +08:00
; OBJ64-NEXT: 0x124 IMAGE_REL_AMD64_SECREL f
; OBJ64-NEXT: 0x128 IMAGE_REL_AMD64_SECTION f
2015-07-09 08:19:51 +08:00
; OBJ64-NEXT: 0x13C IMAGE_REL_AMD64_SECREL f
; OBJ64-NEXT: 0x140 IMAGE_REL_AMD64_SECTION f
2014-10-24 09:27:45 +08:00
; OBJ64-NEXT: ]
; OBJ64: Subsection [
; OBJ64-NEXT: Type: 0xF1
; OBJ64-NOT: ]
; OBJ64: ProcStart {
2014-11-13 04:10:09 +08:00
; OBJ64-NEXT: DisplayName: x
2014-10-24 09:27:45 +08:00
; OBJ64-NEXT: Section: x
; OBJ64-NEXT: CodeSize: 0xE
; OBJ64-NEXT: }
; OBJ64-NEXT: ProcEnd
2014-01-30 09:39:17 +08:00
; OBJ64-NEXT: ]
2014-10-24 09:27:45 +08:00
; OBJ64: Subsection [
; OBJ64-NEXT: Type: 0xF2
; OBJ64: ]
; OBJ64: Subsection [
; OBJ64-NEXT: Type: 0xF1
; OBJ64-NOT: ]
; OBJ64: ProcStart {
2014-11-13 04:10:09 +08:00
; OBJ64-NEXT: DisplayName: y
2014-10-24 09:27:45 +08:00
; OBJ64-NEXT: Section: y
; OBJ64-NEXT: CodeSize: 0xE
; OBJ64-NEXT: }
; OBJ64-NEXT: ProcEnd
; OBJ64-NEXT: ]
; OBJ64: Subsection [
; OBJ64-NEXT: Type: 0xF2
; OBJ64: ]
; OBJ64: Subsection [
; OBJ64-NEXT: Type: 0xF1
; OBJ64-NOT: ]
; OBJ64: ProcStart {
2014-11-13 04:10:09 +08:00
; OBJ64-NEXT: DisplayName: f
2014-10-24 09:27:45 +08:00
; OBJ64-NEXT: Section: f
; OBJ64-NEXT: CodeSize: 0x18
; OBJ64-NEXT: }
; OBJ64-NEXT: ProcEnd
; OBJ64-NEXT: ]
; OBJ64: Subsection [
; OBJ64-NEXT: Type: 0xF2
; OBJ64: ]
2014-01-30 09:39:17 +08:00
; OBJ64: FunctionLineTable [
; OBJ64-NEXT: Name: x
2015-07-09 08:19:51 +08:00
; OBJ64-NEXT: Flags: 0x1
2014-01-30 09:39:17 +08:00
; OBJ64-NEXT: CodeSize: 0xE
; OBJ64-NEXT: FilenameSegment [
; OBJ64-NEXT: Filename: D:\source.c
; OBJ64-NEXT: +0x0: 3
; OBJ64-NEXT: +0x4: 4
; OBJ64-NEXT: +0x9: 5
2015-07-09 08:19:51 +08:00
; OBJ64-NEXT: ColStart: 0
; OBJ64-NEXT: ColEnd: 0
; OBJ64-NEXT: ColStart: 42
2016-01-13 05:58:20 +08:00
; OBJ64-NEXT: ColEnd: 0
2015-07-09 08:19:51 +08:00
; OBJ64-NEXT: ColStart: 43
2016-01-13 05:58:20 +08:00
; OBJ64-NEXT: ColEnd: 0
2014-01-30 09:39:17 +08:00
; OBJ64-NEXT: ]
; OBJ64-NEXT: ]
; OBJ64-NEXT: FunctionLineTable [
; OBJ64-NEXT: Name: y
2015-07-09 08:19:51 +08:00
; OBJ64-NEXT: Flags: 0x1
2014-01-30 09:39:17 +08:00
; OBJ64-NEXT: CodeSize: 0xE
; OBJ64-NEXT: FilenameSegment [
; OBJ64-NEXT: Filename: D:\source.c
; OBJ64-NEXT: +0x0: 7
; OBJ64-NEXT: +0x4: 8
; OBJ64-NEXT: +0x9: 9
2015-07-09 08:19:51 +08:00
; OBJ64-NEXT: ColStart: 0
; OBJ64-NEXT: ColEnd: 0
; OBJ64-NEXT: ColStart: 52
2016-01-13 05:58:20 +08:00
; OBJ64-NEXT: ColEnd: 0
2015-07-09 08:19:51 +08:00
; OBJ64-NEXT: ColStart: 53
2016-01-13 05:58:20 +08:00
; OBJ64-NEXT: ColEnd: 0
2014-01-30 09:39:17 +08:00
; OBJ64-NEXT: ]
; OBJ64-NEXT: ]
; OBJ64-NEXT: FunctionLineTable [
; OBJ64-NEXT: Name: f
2015-07-09 08:19:51 +08:00
; OBJ64-NEXT: Flags: 0x1
2014-01-30 09:39:17 +08:00
; OBJ64-NEXT: CodeSize: 0x18
; OBJ64-NEXT: FilenameSegment [
; OBJ64-NEXT: Filename: D:\source.c
; OBJ64-NEXT: +0x0: 11
; OBJ64-NEXT: +0x4: 12
; OBJ64-NEXT: +0x9: 13
; OBJ64-NEXT: +0xE: 14
; OBJ64-NEXT: +0x13: 15
2015-07-09 08:19:51 +08:00
; OBJ64-NEXT: ColStart: 0
; OBJ64-NEXT: ColEnd: 0
; OBJ64-NEXT: ColStart: 62
2016-01-13 05:58:20 +08:00
; OBJ64-NEXT: ColEnd: 0
2015-07-09 08:19:51 +08:00
; OBJ64-NEXT: ColStart: 63
2016-01-13 05:58:20 +08:00
; OBJ64-NEXT: ColEnd: 0
2015-07-09 08:19:51 +08:00
; OBJ64-NEXT: ColStart: 72
2016-01-13 05:58:20 +08:00
; OBJ64-NEXT: ColEnd: 0
2015-07-09 08:19:51 +08:00
; OBJ64-NEXT: ColStart: 73
2016-01-13 05:58:20 +08:00
; OBJ64-NEXT: ColEnd: 0
2014-01-30 09:39:17 +08:00
; OBJ64-NEXT: ]
; OBJ64-NEXT: ]
; Function Attrs: nounwind
2015-11-06 06:03:56 +08:00
define void @x ( ) #0 !dbg !4 {
2014-01-30 09:39:17 +08:00
entry:
call void @z ( ) , !dbg !14
ret void , !dbg !15
}
declare void @z ( ) #1
; Function Attrs: nounwind
2015-11-06 06:03:56 +08:00
define void @y ( ) #0 !dbg !9 {
2014-01-30 09:39:17 +08:00
entry:
call void @z ( ) , !dbg !16
ret void , !dbg !17
}
; Function Attrs: nounwind
2015-11-06 06:03:56 +08:00
define void @f ( ) #0 !dbg !10 {
2014-01-30 09:39:17 +08:00
entry:
call void @x ( ) , !dbg !18
call void @y ( ) , !dbg !19
call void @z ( ) , !dbg !20
ret void , !dbg !21
}
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" }
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" }
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !11 , !12 }
!llvm.ident = ! { !13 }
2015-08-04 01:26:41 +08:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , producer: "clang version 3.5 " , isOptimized: false , emissionKind: 0 , file: !1 , enums: !2 , retainedTypes: !2 , subprograms: !3 , globals: !2 , imports: !2 )
2015-04-30 00:38:44 +08:00
!1 = !DIFile ( filename: "<unknown>" , directory: "D:\5C" )
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!2 = ! { }
!3 = ! { !4 , !9 , !10 }
2015-11-06 06:03:56 +08:00
!4 = distinct !DISubprogram ( name: "x" , line: 3 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 3 , file: !5 , scope: !6 , type: !7 , variables: !2 )
2015-04-30 00:38:44 +08:00
!5 = !DIFile ( filename: "source.c" , directory: "D:\5C" )
!6 = !DIFile ( filename: "source.c" , directory: "D:C" )
!7 = !DISubroutineType ( types: !8 )
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!8 = ! { null }
2015-11-06 06:03:56 +08:00
!9 = distinct !DISubprogram ( name: "y" , line: 7 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 7 , file: !5 , scope: !6 , type: !7 , variables: !2 )
!10 = distinct !DISubprogram ( name: "f" , line: 11 , isLocal: false , isDefinition: true , virtualIndex: 6 , flags: D I F l a g P r o t o t y p e d , isOptimized: false , scopeLine: 11 , file: !5 , scope: !6 , type: !7 , variables: !2 )
2015-08-06 06:26:20 +08:00
!11 = ! { i32 2 , !"CodeView" , i32 1 }
2015-03-04 01:24:31 +08:00
!12 = ! { i32 1 , !"Debug Info Version" , i32 3 }
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
llvm-svn: 224257
2014-12-16 03:07:53 +08:00
!13 = ! { !"clang version 3.5 " }
2015-07-09 08:19:51 +08:00
!14 = !DILocation ( line: 4 , column: 42 , scope: !4 )
!15 = !DILocation ( line: 5 , column: 43 , scope: !4 )
!16 = !DILocation ( line: 8 , column: 52 , scope: !9 )
!17 = !DILocation ( line: 9 , column: 53 , scope: !9 )
!18 = !DILocation ( line: 12 , column: 62 , scope: !10 )
!19 = !DILocation ( line: 13 , column: 63 , scope: !10 )
!20 = !DILocation ( line: 14 , column: 72 , scope: !10 )
!21 = !DILocation ( line: 15 , column: 73 , scope: !10 )