2010-08-24 21:04:52 +00:00
|
|
|
; This test checks that the COFF object emitter works for the most basic
|
|
|
|
; programs.
|
2010-07-27 06:46:15 +00:00
|
|
|
|
2010-08-24 21:04:52 +00:00
|
|
|
; RUN: llc -filetype=obj -mtriple i686-pc-win32 %s -o %t
|
|
|
|
; RUN: coff-dump.py %abs_tmp | FileCheck %s
|
|
|
|
; RUN: llc -filetype=obj -mtriple x86_64-pc-win32 %s -o %t
|
2010-07-27 06:46:15 +00:00
|
|
|
|
|
|
|
@.str = private constant [12 x i8] c"Hello World\00" ; <[12 x i8]*> [#uses=1]
|
|
|
|
|
|
|
|
define i32 @main() nounwind {
|
|
|
|
entry:
|
|
|
|
%call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8]* @.str, i32 0, i32 0)) nounwind ; <i32> [#uses=0]
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i32 @printf(i8* nocapture, ...) nounwind
|
|
|
|
|
|
|
|
; CHECK: {
|
|
|
|
; CHECK: MachineType = IMAGE_FILE_MACHINE_I386 (0x14C)
|
|
|
|
; CHECK: NumberOfSections = 2
|
|
|
|
; CHECK: TimeDateStamp = {{[0-9]+}}
|
2010-09-27 08:58:26 +00:00
|
|
|
; CHECK: PointerToSymbolTable = 0x{{[0-9A-F]+}}
|
|
|
|
; CHECK: NumberOfSymbols = 6
|
2010-07-27 06:46:15 +00:00
|
|
|
; CHECK: SizeOfOptionalHeader = 0
|
|
|
|
; CHECK: Characteristics = 0x0
|
|
|
|
; CHECK: Sections = [
|
2010-09-15 03:58:51 +00:00
|
|
|
; CHECK: 1 = {
|
2010-07-27 06:46:15 +00:00
|
|
|
; CHECK: Name = .text
|
|
|
|
; CHECK: VirtualSize = 0
|
|
|
|
; CHECK: VirtualAddress = 0
|
2010-09-27 08:58:26 +00:00
|
|
|
; CHECK: SizeOfRawData = {{[0-9]+}}
|
|
|
|
; CHECK: PointerToRawData = 0x{{[0-9A-F]+}}
|
|
|
|
; CHECK: PointerToRelocations = 0x{{[0-9A-F]+}}
|
2010-07-27 06:46:15 +00:00
|
|
|
; CHECK: PointerToLineNumbers = 0x0
|
|
|
|
; CHECK: NumberOfRelocations = 2
|
|
|
|
; CHECK: NumberOfLineNumbers = 0
|
|
|
|
; CHECK: Charateristics = 0x60500020
|
|
|
|
; CHECK: IMAGE_SCN_CNT_CODE
|
|
|
|
; CHECK: IMAGE_SCN_ALIGN_16BYTES
|
|
|
|
; CHECK: IMAGE_SCN_MEM_EXECUTE
|
|
|
|
; CHECK: IMAGE_SCN_MEM_READ
|
|
|
|
; CHECK: SectionData =
|
|
|
|
; CHECK: Relocations = [
|
|
|
|
; CHECK: 0 = {
|
2010-09-27 08:58:26 +00:00
|
|
|
; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
|
|
|
|
; CHECK: SymbolTableIndex = 2
|
2010-07-27 06:46:15 +00:00
|
|
|
; CHECK: Type = IMAGE_REL_I386_DIR32 (6)
|
2010-09-27 08:58:26 +00:00
|
|
|
; CHECK: SymbolName =
|
2010-07-27 06:46:15 +00:00
|
|
|
; CHECK: }
|
|
|
|
; CHECK: 1 = {
|
2010-09-27 08:58:26 +00:00
|
|
|
; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
|
|
|
|
; CHECK: SymbolTableIndex = 5
|
2010-07-27 06:46:15 +00:00
|
|
|
; CHECK: Type = IMAGE_REL_I386_REL32 (20)
|
2010-09-27 08:58:26 +00:00
|
|
|
; CHECK: SymbolName = _main
|
2010-07-27 06:46:15 +00:00
|
|
|
; CHECK: }
|
|
|
|
; CHECK: ]
|
|
|
|
; CHECK: }
|
2010-09-15 03:58:51 +00:00
|
|
|
; CHECK: 2 = {
|
2010-07-27 06:46:15 +00:00
|
|
|
; CHECK: Name = .data
|
|
|
|
; CHECK: VirtualSize = 0
|
|
|
|
; CHECK: VirtualAddress = 0
|
2010-09-27 08:58:26 +00:00
|
|
|
; CHECK: SizeOfRawData = {{[0-9]+}}
|
|
|
|
; CHECK: PointerToRawData = 0x{{[0-9A-F]+}}
|
2010-07-27 06:46:15 +00:00
|
|
|
; CHECK: PointerToRelocations = 0x0
|
|
|
|
; CHECK: PointerToLineNumbers = 0x0
|
|
|
|
; CHECK: NumberOfRelocations = 0
|
|
|
|
; CHECK: NumberOfLineNumbers = 0
|
|
|
|
; CHECK: Charateristics = 0xC0100040
|
|
|
|
; CHECK: IMAGE_SCN_CNT_INITIALIZED_DATA
|
|
|
|
; CHECK: IMAGE_SCN_ALIGN_1BYTES
|
|
|
|
; CHECK: IMAGE_SCN_MEM_READ
|
|
|
|
; CHECK: IMAGE_SCN_MEM_WRITE
|
|
|
|
; CHECK: SectionData =
|
|
|
|
; CHECK: 48 65 6C 6C 6F 20 57 6F - 72 6C 64 00 |Hello World.|
|
|
|
|
; CHECK: Relocations = None
|
|
|
|
; CHECK: }
|
|
|
|
; CHECK: ]
|
|
|
|
; CHECK: Symbols = [
|
|
|
|
; CHECK: 0 = {
|
|
|
|
; CHECK: Name = .text
|
|
|
|
; CHECK: Value = 0
|
|
|
|
; CHECK: SectionNumber = 1
|
|
|
|
; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0)
|
|
|
|
; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0)
|
|
|
|
; CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3)
|
|
|
|
; CHECK: NumberOfAuxSymbols = 1
|
|
|
|
; CHECK: AuxillaryData =
|
|
|
|
; CHECK: 15 00 00 00 02 00 00 00 - 00 00 00 00 01 00 00 00 |................|
|
|
|
|
; CHECK: 00 00 |..|
|
|
|
|
; CHECK: }
|
|
|
|
; CHECK: 1 = {
|
|
|
|
; CHECK: Name = .data
|
|
|
|
; CHECK: Value = 0
|
|
|
|
; CHECK: SectionNumber = 2
|
|
|
|
; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0)
|
|
|
|
; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0)
|
|
|
|
; CHECK: StorageClass = IMAGE_SYM_CLASS_STATIC (3)
|
|
|
|
; CHECK: NumberOfAuxSymbols = 1
|
|
|
|
; CHECK: AuxillaryData =
|
|
|
|
; CHECK: 0C 00 00 00 00 00 00 00 - 00 00 00 00 02 00 00 00 |................|
|
|
|
|
; CHECK: 00 00 |..|
|
|
|
|
; CHECK: }
|
|
|
|
; CHECK: 2 = {
|
|
|
|
; CHECK: Name = _main
|
|
|
|
; CHECK: Value = 0
|
|
|
|
; CHECK: SectionNumber = 1
|
2010-09-01 14:15:31 +00:00
|
|
|
; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0)
|
|
|
|
; CHECK: ComplexType = IMAGE_SYM_DTYPE_FUNCTION (2)
|
2010-07-27 06:46:15 +00:00
|
|
|
; CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2)
|
|
|
|
; CHECK: NumberOfAuxSymbols = 0
|
|
|
|
; CHECK: AuxillaryData =
|
|
|
|
; CHECK: }
|
|
|
|
; CHECK: 3 = {
|
|
|
|
; CHECK: Name = _printf
|
|
|
|
; CHECK: Value = 0
|
|
|
|
; CHECK: SectionNumber = 0
|
|
|
|
; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0)
|
|
|
|
; CHECK: ComplexType = IMAGE_SYM_DTYPE_NULL (0)
|
|
|
|
; CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2)
|
|
|
|
; CHECK: NumberOfAuxSymbols = 0
|
|
|
|
; CHECK: AuxillaryData =
|
|
|
|
; CHECK: }
|
|
|
|
; CHECK: ]
|
|
|
|
; CHECK: }
|