[llvm-commits] [llvm] r116150 - in /llvm/trunk: lib/MC/MCParser/AsmParser.cpp lib/MC/MCParser/CMakeLists.txt lib/MC/MCParser/COFFAsmParser.cpp test/MC/COFF/align-nops.s test/MC/COFF/basic-coff.ll test/MC/COFF/basic-coff.s test/MC/COFF/simple-fixups.ll test/MC/COFF/simple-fixups.s test/MC/COFF/switch-relocations.ll test/MC/COFF/symbol-alias.ll test/MC/COFF/symbol-alias.s test/MC/COFF/symbol-fragment-offset.ll test/MC/COFF/symbol-fragment-offset.s
Michael J. Spencer
bigcheesegs at gmail.com
Sat Oct 9 04:01:07 PDT 2010
Author: mspencer
Date: Sat Oct 9 06:01:07 2010
New Revision: 116150
URL: http://llvm.org/viewvc/llvm-project?rev=116150&view=rev
Log:
MC-COFF: Add COFFAsmParser. Completes PR8343.
Added:
llvm/trunk/lib/MC/MCParser/COFFAsmParser.cpp
llvm/trunk/test/MC/COFF/basic-coff.s
llvm/trunk/test/MC/COFF/simple-fixups.s
llvm/trunk/test/MC/COFF/symbol-alias.s
llvm/trunk/test/MC/COFF/symbol-fragment-offset.s
Removed:
llvm/trunk/test/MC/COFF/basic-coff.ll
llvm/trunk/test/MC/COFF/simple-fixups.ll
llvm/trunk/test/MC/COFF/symbol-alias.ll
llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll
Modified:
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/lib/MC/MCParser/CMakeLists.txt
llvm/trunk/test/MC/COFF/align-nops.s
llvm/trunk/test/MC/COFF/switch-relocations.ll
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=116150&r1=116149&r2=116150&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Sat Oct 9 06:01:07 2010
@@ -269,6 +269,7 @@
extern MCAsmParserExtension *createDarwinAsmParser();
extern MCAsmParserExtension *createELFAsmParser();
+extern MCAsmParserExtension *createCOFFAsmParser();
}
@@ -288,7 +289,10 @@
//
// FIXME: This is a hack, we need to (majorly) cleanup how these objects are
// created.
- if (_MAI.hasSubsectionsViaSymbols()) {
+ if (_MAI.hasMicrosoftFastStdCallMangling()) {
+ PlatformParser = createCOFFAsmParser();
+ PlatformParser->Initialize(*this);
+ } else if (_MAI.hasSubsectionsViaSymbols()) {
PlatformParser = createDarwinAsmParser();
PlatformParser->Initialize(*this);
} else {
Modified: llvm/trunk/lib/MC/MCParser/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/CMakeLists.txt?rev=116150&r1=116149&r2=116150&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/CMakeLists.txt (original)
+++ llvm/trunk/lib/MC/MCParser/CMakeLists.txt Sat Oct 9 06:01:07 2010
@@ -1,6 +1,7 @@
add_llvm_library(LLVMMCParser
AsmLexer.cpp
AsmParser.cpp
+ COFFAsmParser.cpp
DarwinAsmParser.cpp
ELFAsmParser.cpp
MCAsmLexer.cpp
Added: llvm/trunk/lib/MC/MCParser/COFFAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/COFFAsmParser.cpp?rev=116150&view=auto
==============================================================================
--- llvm/trunk/lib/MC/MCParser/COFFAsmParser.cpp (added)
+++ llvm/trunk/lib/MC/MCParser/COFFAsmParser.cpp Sat Oct 9 06:01:07 2010
@@ -0,0 +1,144 @@
+//===- COFFAsmParser.cpp - COFF Assembly Parser ---------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/MC/MCParser/MCAsmParserExtension.h"
+#include "llvm/ADT/Twine.h"
+#include "llvm/MC/MCAsmInfo.h"
+#include "llvm/MC/MCContext.h"
+#include "llvm/MC/MCParser/MCAsmLexer.h"
+#include "llvm/MC/MCSectionCOFF.h"
+#include "llvm/MC/MCStreamer.h"
+#include "llvm/Support/COFF.h"
+using namespace llvm;
+
+namespace {
+
+class COFFAsmParser : public MCAsmParserExtension {
+ template<bool (COFFAsmParser::*Handler)(StringRef, SMLoc)>
+ void AddDirectiveHandler(StringRef Directive) {
+ getParser().AddDirectiveHandler(this, Directive,
+ HandleDirective<COFFAsmParser, Handler>);
+ }
+
+ bool ParseSectionSwitch(StringRef Section,
+ unsigned Characteristics,
+ SectionKind Kind);
+
+ virtual void Initialize(MCAsmParser &Parser) {
+ // Call the base implementation.
+ MCAsmParserExtension::Initialize(Parser);
+
+ AddDirectiveHandler<&COFFAsmParser::ParseSectionDirectiveText>(".text");
+ AddDirectiveHandler<&COFFAsmParser::ParseSectionDirectiveData>(".data");
+ AddDirectiveHandler<&COFFAsmParser::ParseSectionDirectiveBSS>(".bss");
+ AddDirectiveHandler<&COFFAsmParser::ParseDirectiveDef>(".def");
+ AddDirectiveHandler<&COFFAsmParser::ParseDirectiveScl>(".scl");
+ AddDirectiveHandler<&COFFAsmParser::ParseDirectiveType>(".type");
+ AddDirectiveHandler<&COFFAsmParser::ParseDirectiveEndef>(".endef");
+ }
+
+ bool ParseSectionDirectiveText(StringRef, SMLoc) {
+ return ParseSectionSwitch(".text",
+ COFF::IMAGE_SCN_CNT_CODE
+ | COFF::IMAGE_SCN_MEM_EXECUTE
+ | COFF::IMAGE_SCN_MEM_READ,
+ SectionKind::getText());
+ }
+ bool ParseSectionDirectiveData(StringRef, SMLoc) {
+ return ParseSectionSwitch(".data",
+ COFF::IMAGE_SCN_CNT_INITIALIZED_DATA
+ | COFF::IMAGE_SCN_MEM_READ
+ | COFF::IMAGE_SCN_MEM_WRITE,
+ SectionKind::getDataRel());
+ }
+ bool ParseSectionDirectiveBSS(StringRef, SMLoc) {
+ return ParseSectionSwitch(".bss",
+ COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA
+ | COFF::IMAGE_SCN_MEM_READ
+ | COFF::IMAGE_SCN_MEM_WRITE,
+ SectionKind::getBSS());
+ }
+
+ bool ParseDirectiveDef(StringRef, SMLoc);
+ bool ParseDirectiveScl(StringRef, SMLoc);
+ bool ParseDirectiveType(StringRef, SMLoc);
+ bool ParseDirectiveEndef(StringRef, SMLoc);
+
+public:
+ COFFAsmParser() {}
+};
+
+} // end annonomous namespace.
+
+bool COFFAsmParser::ParseSectionSwitch(StringRef Section,
+ unsigned Characteristics,
+ SectionKind Kind) {
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in section switching directive");
+ Lex();
+
+ getStreamer().SwitchSection(getContext().getCOFFSection(
+ Section, Characteristics, Kind));
+
+ return false;
+}
+
+bool COFFAsmParser::ParseDirectiveDef(StringRef, SMLoc) {
+ StringRef SymbolName;
+
+ if (getParser().ParseIdentifier(SymbolName))
+ return TokError("expected identifier in directive");
+
+ MCSymbol *Sym = getContext().GetOrCreateSymbol(SymbolName);
+
+ getStreamer().BeginCOFFSymbolDef(Sym);
+
+ Lex();
+ return false;
+}
+
+bool COFFAsmParser::ParseDirectiveScl(StringRef, SMLoc) {
+ int64_t SymbolStorageClass;
+ if (getParser().ParseAbsoluteExpression(SymbolStorageClass))
+ return true;
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in directive");
+
+ Lex();
+ getStreamer().EmitCOFFSymbolStorageClass(SymbolStorageClass);
+ return false;
+}
+
+bool COFFAsmParser::ParseDirectiveType(StringRef, SMLoc) {
+ int64_t Type;
+ if (getParser().ParseAbsoluteExpression(Type))
+ return true;
+
+ if (getLexer().isNot(AsmToken::EndOfStatement))
+ return TokError("unexpected token in directive");
+
+ Lex();
+ getStreamer().EmitCOFFSymbolType(Type);
+ return false;
+}
+
+bool COFFAsmParser::ParseDirectiveEndef(StringRef, SMLoc) {
+ Lex();
+ getStreamer().EndCOFFSymbolDef();
+ return false;
+}
+
+namespace llvm {
+
+MCAsmParserExtension *createCOFFAsmParser() {
+ return new COFFAsmParser;
+}
+
+}
Modified: llvm/trunk/test/MC/COFF/align-nops.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/align-nops.s?rev=116150&r1=116149&r2=116150&view=diff
==============================================================================
--- llvm/trunk/test/MC/COFF/align-nops.s (original)
+++ llvm/trunk/test/MC/COFF/align-nops.s Sat Oct 9 06:01:07 2010
@@ -24,8 +24,11 @@
//CHECK-NEXT: PointerToLineNumbers
//CHECK-NEXT: NumberOfRelocations
//CHECK-NEXT: NumberOfLineNumbers
-//CHECK-NEXT: Charateristics = 0x400001
+//CHECK-NEXT: Charateristics = 0x60400020
+//CHECK-NEXT: IMAGE_SCN_CNT_CODE
//CHECK-NEXT: IMAGE_SCN_ALIGN_8BYTES
+//CHECK-NEXT: IMAGE_SCN_MEM_EXECUTE
+//CHECK-NEXT: IMAGE_SCN_MEM_READ
//CHECK-NEXT: SectionData =
//CHECK-NEXT: 00 00 00 00 0F 1F 40 00 - 00 00 00 00 0F 1F 40 00
@@ -38,7 +41,10 @@
//CHECK-NEXT: PointerToLineNumbers
//CHECK-NEXT: NumberOfRelocations
//CHECK-NEXT: NumberOfLineNumbers
-//CHECK-NEXT: Charateristics = 0x400001
+//CHECK-NEXT: Charateristics = 0xC0400040
+//CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
//CHECK-NEXT: IMAGE_SCN_ALIGN_8BYTES
+//CHECK-NEXT: IMAGE_SCN_MEM_READ
+//CHECK-NEXT: IMAGE_SCN_MEM_WRITE
//CHECK-NEXT: SectionData =
//CHECK-NEXT: 00 00 00 00 90 90 90 90 - 00 00 00 00 00 00 00 00
Removed: llvm/trunk/test/MC/COFF/basic-coff.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/basic-coff.ll?rev=116149&view=auto
==============================================================================
--- llvm/trunk/test/MC/COFF/basic-coff.ll (original)
+++ llvm/trunk/test/MC/COFF/basic-coff.ll (removed)
@@ -1,123 +0,0 @@
-; This test checks that the COFF object emitter works for the most basic
-; programs.
-
-; RUN: llc -filetype=obj -mtriple i686-pc-win32 %s -o - | coff-dump.py | FileCheck %s
-; RUN: llc -filetype=obj -mtriple x86_64-pc-win32 %s -o %t
-
- at .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]+}}
-; CHECK: PointerToSymbolTable = 0x{{[0-9A-F]+}}
-; CHECK: NumberOfSymbols = 6
-; CHECK: SizeOfOptionalHeader = 0
-; CHECK: Characteristics = 0x0
-; CHECK: Sections = [
-; CHECK: 1 = {
-; CHECK: Name = .text
-; CHECK: VirtualSize = 0
-; CHECK: VirtualAddress = 0
-; CHECK: SizeOfRawData = {{[0-9]+}}
-; CHECK: PointerToRawData = 0x{{[0-9A-F]+}}
-; CHECK: PointerToRelocations = 0x{{[0-9A-F]+}}
-; 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 = {
-; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
-; CHECK: SymbolTableIndex = 2
-; CHECK: Type = IMAGE_REL_I386_DIR32 (6)
-; CHECK: SymbolName = .data
-; CHECK: }
-; CHECK: 1 = {
-; CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
-; CHECK: SymbolTableIndex = 5
-; CHECK: Type = IMAGE_REL_I386_REL32 (20)
-; CHECK: SymbolName = _printf
-; CHECK: }
-; CHECK: ]
-; CHECK: }
-; CHECK: 2 = {
-; CHECK: Name = .data
-; CHECK: VirtualSize = 0
-; CHECK: VirtualAddress = 0
-; CHECK: SizeOfRawData = {{[0-9]+}}
-; CHECK: PointerToRawData = 0x{{[0-9A-F]+}}
-; 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: 2 = {
-; 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: 4 = {
-; CHECK: Name = _main
-; CHECK: Value = 0
-; CHECK: SectionNumber = 1
-; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0)
-; CHECK: ComplexType = IMAGE_SYM_DTYPE_FUNCTION (2)
-; CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2)
-; CHECK: NumberOfAuxSymbols = 0
-; CHECK: AuxillaryData =
-; CHECK: }
-; CHECK: 5 = {
-; 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: }
Added: llvm/trunk/test/MC/COFF/basic-coff.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/basic-coff.s?rev=116150&view=auto
==============================================================================
--- llvm/trunk/test/MC/COFF/basic-coff.s (added)
+++ llvm/trunk/test/MC/COFF/basic-coff.s Sat Oct 9 06:01:07 2010
@@ -0,0 +1,133 @@
+// This test checks that the COFF object emitter works for the most basic
+// programs.
+
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | coff-dump.py | FileCheck %s
+// I WOULD RUN, BUT THIS FAILS: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s
+
+.def _main;
+ .scl 2;
+ .type 32;
+ .endef
+ .text
+ .globl _main
+ .align 16, 0x90
+_main: # @main
+# BB#0: # %entry
+ subl $4, %esp
+ movl $L_.str, (%esp)
+ calll _printf
+ xorl %eax, %eax
+ addl $4, %esp
+ ret
+
+ .data
+L_.str: # @.str
+ .asciz "Hello World"
+
+// CHECK: {
+// CHECK: MachineType = IMAGE_FILE_MACHINE_I386 (0x14C)
+// CHECK: NumberOfSections = 2
+// CHECK: TimeDateStamp = {{[0-9]+}}
+// CHECK: PointerToSymbolTable = 0x{{[0-9A-F]+}}
+// CHECK: NumberOfSymbols = 6
+// CHECK: SizeOfOptionalHeader = 0
+// CHECK: Characteristics = 0x0
+// CHECK: Sections = [
+// CHECK: 1 = {
+// CHECK: Name = .text
+// CHECK: VirtualSize = 0
+// CHECK: VirtualAddress = 0
+// CHECK: SizeOfRawData = {{[0-9]+}}
+// CHECK: PointerToRawData = 0x{{[0-9A-F]+}}
+// CHECK: PointerToRelocations = 0x{{[0-9A-F]+}}
+// 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 = {
+// CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
+// CHECK: SymbolTableIndex = 2
+// CHECK: Type = IMAGE_REL_I386_DIR32 (6)
+// CHECK: SymbolName = .data
+// CHECK: }
+// CHECK: 1 = {
+// CHECK: VirtualAddress = 0x{{[0-9A-F]+}}
+// CHECK: SymbolTableIndex = 5
+// CHECK: Type = IMAGE_REL_I386_REL32 (20)
+// CHECK: SymbolName = _printf
+// CHECK: }
+// CHECK: ]
+// CHECK: }
+// CHECK: 2 = {
+// CHECK: Name = .data
+// CHECK: VirtualSize = 0
+// CHECK: VirtualAddress = 0
+// CHECK: SizeOfRawData = {{[0-9]+}}
+// CHECK: PointerToRawData = 0x{{[0-9A-F]+}}
+// 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: 2 = {
+// 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: 4 = {
+// CHECK: Name = _main
+// CHECK: Value = 0
+// CHECK: SectionNumber = 1
+// CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0)
+// CHECK: ComplexType = IMAGE_SYM_DTYPE_FUNCTION (2)
+// CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2)
+// CHECK: NumberOfAuxSymbols = 0
+// CHECK: AuxillaryData =
+// CHECK: }
+// CHECK: 5 = {
+// 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: }
Removed: llvm/trunk/test/MC/COFF/simple-fixups.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/simple-fixups.ll?rev=116149&view=auto
==============================================================================
--- llvm/trunk/test/MC/COFF/simple-fixups.ll (original)
+++ llvm/trunk/test/MC/COFF/simple-fixups.ll (removed)
@@ -1,29 +0,0 @@
-; The purpose of this test is to verify that we do not produce unneeded
-; relocations when symbols are in the same section and we know their offset.
-
-; RUN: llc -filetype=obj -mtriple i686-pc-win32 %s -o - | coff-dump.py | FileCheck %s
-; RUN: llc -filetype=obj -mtriple x86_64-pc-win32 %s -o - | coff-dump.py | FileCheck %s
-
-define void @foo() {
-e:
- br label %i
-i:
- br label %i
-}
-
-define void @bar() {
-e:
- br label %i
-i:
- br label %i
-}
-
-define void @baz() {
-e:
- call void @baz()
- ret void
-}
-
-; CHECK: Sections = [
-; CHECK-NOT: NumberOfRelocations = {{[^0]}}
-; CHECK: Symbols = [
Added: llvm/trunk/test/MC/COFF/simple-fixups.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/simple-fixups.s?rev=116150&view=auto
==============================================================================
--- llvm/trunk/test/MC/COFF/simple-fixups.s (added)
+++ llvm/trunk/test/MC/COFF/simple-fixups.s Sat Oct 9 06:01:07 2010
@@ -0,0 +1,50 @@
+// The purpose of this test is to verify that we do not produce unneeded
+// relocations when symbols are in the same section and we know their offset.
+
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | coff-dump.py | FileCheck %s
+// I WOULD RUN, BUT THIS FAILS: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | coff-dump.py | FileCheck %s
+
+ .def _foo;
+ .scl 2;
+ .type 32;
+ .endef
+ .text
+ .globl _foo
+ .align 16, 0x90
+_foo: # @foo
+# BB#0: # %e
+ .align 16, 0x90
+LBB0_1: # %i
+ # =>This Inner Loop Header: Depth=1
+ jmp LBB0_1
+
+ .def _bar;
+ .scl 2;
+ .type 32;
+ .endef
+ .globl _bar
+ .align 16, 0x90
+_bar: # @bar
+# BB#0: # %e
+ .align 16, 0x90
+LBB1_1: # %i
+ # =>This Inner Loop Header: Depth=1
+ jmp LBB1_1
+
+ .def _baz;
+ .scl 2;
+ .type 32;
+ .endef
+ .globl _baz
+ .align 16, 0x90
+_baz: # @baz
+# BB#0: # %e
+ subl $4, %esp
+Ltmp0:
+ calll _baz
+ addl $4, %esp
+ ret
+
+// CHECK: Sections = [
+// CHECK-NOT: NumberOfRelocations = {{[^0]}}
+// CHECK: Symbols = [
Modified: llvm/trunk/test/MC/COFF/switch-relocations.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/switch-relocations.ll?rev=116150&r1=116149&r2=116150&view=diff
==============================================================================
--- llvm/trunk/test/MC/COFF/switch-relocations.ll (original)
+++ llvm/trunk/test/MC/COFF/switch-relocations.ll Sat Oct 9 06:01:07 2010
@@ -3,6 +3,9 @@
; This test case was reduced from Lua/lapi.c.
+; This test has yet to be converted to assembly becase llvm-mc cannot read
+; x86-64 COFF code yet.
+
; RUN: llc -filetype=obj -mtriple i686-pc-win32 %s -o %t
; RUN: llc -filetype=obj -mtriple x86_64-pc-win32 %s -o %t
Removed: llvm/trunk/test/MC/COFF/symbol-alias.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/symbol-alias.ll?rev=116149&view=auto
==============================================================================
--- llvm/trunk/test/MC/COFF/symbol-alias.ll (original)
+++ llvm/trunk/test/MC/COFF/symbol-alias.ll (removed)
@@ -1,48 +0,0 @@
-; The purpose of this test is to verify that symbol aliases
-; (@foo = alias <type> @bar) generate the correct entries in the symbol table.
-; They should be identical except for the name.
-
-; RUN: llc -filetype=obj -mtriple i686-pc-win32 %s -o - | coff-dump.py | FileCheck %s
-; RUN: llc -filetype=obj -mtriple x86_64-pc-win32 %s -o - | coff-dump.py | FileCheck %s
-
-define void @foo() {
-entry:
- ret void
-}
-
- at bar = global i32 zeroinitializer
-
- at foo_alias = alias void ()* @foo
- at bar_alias = alias i32* @bar
-
-; CHECK: Name = {{_?}}foo
-; CHECK-NEXT: Value = [[FOO_VALUE:.*$]]
-; CHECK-NEXT: SectionNumber = [[FOO_SECTION_NUMBER:.*$]]
-; CHECK-NEXT: SimpleType = [[FOO_SIMPLE_TYPE:.*$]]
-; CHECK-NEXT: ComplexType = [[FOO_COMPLEX_TYPE:.*$]]
-; CHECK-NEXT: StorageClass = [[FOO_STORAGE_CLASS:.*$]]
-; CHECK-NEXT: NumberOfAuxSymbols = [[FOO_NUMBER_OF_AUX_SYMBOLS:.*$]]
-
-; CHECK: Name = {{_?}}bar
-; CHECK-NEXT: Value = [[BAR_VALUE:.*$]]
-; CHECK-NEXT: SectionNumber = [[BAR_SECTION_NUMBER:.*$]]
-; CHECK-NEXT: SimpleType = [[BAR_SIMPLE_TYPE:.*$]]
-; CHECK-NEXT: ComplexType = [[BAR_COMPLEX_TYPE:.*$]]
-; CHECK-NEXT: StorageClass = [[BAR_STORAGE_CLASS:.*$]]
-; CHECK-NEXT: NumberOfAuxSymbols = [[BAR_NUMBER_OF_AUX_SYMBOLS:.*$]]
-
-; CHECK: Name = {{_?}}foo_alias
-; CHECK-NEXT: Value = [[FOO_VALUE]]
-; CHECK-NEXT: SectionNumber = [[FOO_SECTION_NUMBER]]
-; CHECK-NEXT: SimpleType = [[FOO_SIMPLE_TYPE]]
-; CHECK-NEXT: ComplexType = [[FOO_COMPLEX_TYPE]]
-; CHECK-NEXT: StorageClass = [[FOO_STORAGE_CLASS]]
-; CHECK-NEXT: NumberOfAuxSymbols = [[FOO_NUMBER_OF_AUX_SYMBOLS]]
-
-; CHECK: Name = {{_?}}bar_alias
-; CHECK-NEXT: Value = [[BAR_VALUE]]
-; CHECK-NEXT: SectionNumber = [[BAR_SECTION_NUMBER]]
-; CHECK-NEXT: SimpleType = [[BAR_SIMPLE_TYPE]]
-; CHECK-NEXT: ComplexType = [[BAR_COMPLEX_TYPE]]
-; CHECK-NEXT: StorageClass = [[BAR_STORAGE_CLASS]]
-; CHECK-NEXT: NumberOfAuxSymbols = [[BAR_NUMBER_OF_AUX_SYMBOLS]]
Added: llvm/trunk/test/MC/COFF/symbol-alias.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/symbol-alias.s?rev=116150&view=auto
==============================================================================
--- llvm/trunk/test/MC/COFF/symbol-alias.s (added)
+++ llvm/trunk/test/MC/COFF/symbol-alias.s Sat Oct 9 06:01:07 2010
@@ -0,0 +1,62 @@
+// The purpose of this test is to verify that symbol aliases
+// (@foo = alias <type> @bar) generate the correct entries in the symbol table.
+// They should be identical except for the name.
+
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | coff-dump.py | FileCheck %s
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | coff-dump.py | FileCheck %s
+
+ .def _foo;
+ .scl 2;
+ .type 32;
+ .endef
+ .text
+ .globl _foo
+ .align 16, 0x90
+_foo: # @foo
+# BB#0: # %entry
+ ret
+
+ .data
+ .globl _bar # @bar
+ .align 4
+_bar:
+ .long 0 # 0x0
+
+
+ .globl _foo_alias
+_foo_alias = _foo
+ .globl _bar_alias
+_bar_alias = _bar
+
+// CHECK: Name = {{_?}}foo
+// CHECK-NEXT: Value = [[FOO_VALUE:.*$]]
+// CHECK-NEXT: SectionNumber = [[FOO_SECTION_NUMBER:.*$]]
+// CHECK-NEXT: SimpleType = [[FOO_SIMPLE_TYPE:.*$]]
+// CHECK-NEXT: ComplexType = [[FOO_COMPLEX_TYPE:.*$]]
+// CHECK-NEXT: StorageClass = [[FOO_STORAGE_CLASS:.*$]]
+// CHECK-NEXT: NumberOfAuxSymbols = [[FOO_NUMBER_OF_AUX_SYMBOLS:.*$]]
+
+// CHECK: Name = {{_?}}bar
+// CHECK-NEXT: Value = [[BAR_VALUE:.*$]]
+// CHECK-NEXT: SectionNumber = [[BAR_SECTION_NUMBER:.*$]]
+// CHECK-NEXT: SimpleType = [[BAR_SIMPLE_TYPE:.*$]]
+// CHECK-NEXT: ComplexType = [[BAR_COMPLEX_TYPE:.*$]]
+// CHECK-NEXT: StorageClass = [[BAR_STORAGE_CLASS:.*$]]
+// CHECK-NEXT: NumberOfAuxSymbols = [[BAR_NUMBER_OF_AUX_SYMBOLS:.*$]]
+
+// CHECK: Name = {{_?}}foo_alias
+// CHECK-NEXT: Value = [[FOO_VALUE]]
+// CHECK-NEXT: SectionNumber = [[FOO_SECTION_NUMBER]]
+// CHECK-NEXT: SimpleType = [[FOO_SIMPLE_TYPE]]
+// CHECK-NEXT: ComplexType = [[FOO_COMPLEX_TYPE]]
+// CHECK-NEXT: StorageClass = [[FOO_STORAGE_CLASS]]
+// CHECK-NEXT: NumberOfAuxSymbols = [[FOO_NUMBER_OF_AUX_SYMBOLS]]
+
+// CHECK: Name = {{_?}}bar_alias
+// CHECK-NEXT: Value = [[BAR_VALUE]]
+// CHECK-NEXT: SectionNumber = [[BAR_SECTION_NUMBER]]
+// CHECK-NEXT: SimpleType = [[BAR_SIMPLE_TYPE]]
+// CHECK-NEXT: ComplexType = [[BAR_COMPLEX_TYPE]]
+// CHECK-NEXT: StorageClass = [[BAR_STORAGE_CLASS]]
+// CHECK-NEXT: NumberOfAuxSymbols = [[BAR_NUMBER_OF_AUX_SYMBOLS]]
+
Removed: llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll?rev=116149&view=auto
==============================================================================
--- llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll (original)
+++ llvm/trunk/test/MC/COFF/symbol-fragment-offset.ll (removed)
@@ -1,172 +0,0 @@
-; The purpose of this test is to see if the COFF object writer is emitting the
-; proper relocations for multiple pieces of data in a single data fragment.
-
-; RUN: llc -filetype=obj -mtriple i686-pc-win32 %s -o - | coff-dump.py | FileCheck %s
-; RUN: llc -filetype=obj -mtriple x86_64-pc-win32 %s -o %t
-
- at .str0 = private constant [7 x i8] c"Hello \00" ; <[7 x i8]*> [#uses=1]
- at .str1 = private constant [7 x i8] c"World!\00" ; <[7 x i8]*> [#uses=1]
- at .str2 = private constant [19 x i8] c"I'm The Last Line.\00"
-
-define i32 @main() nounwind {
-entry:
- %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([7 x i8]* @.str0, i32 0, i32 0)) nounwind ; <i32> [#uses=0]
- %puts0 = tail call i32 @puts(i8* getelementptr inbounds ([7 x i8]* @.str1, i32 0, i32 0)) ; <i32> [#uses=0]
- %puts1 = tail call i32 @puts(i8* getelementptr inbounds ([19 x i8]* @.str2, i32 0, i32 0)) ; <i32> [#uses=0]
- ret i32 0
-}
-
-declare i32 @printf(i8* nocapture, ...) nounwind
-
-declare i32 @puts(i8* nocapture) nounwind
-
-; CHECK: {
-; CHECK: MachineType = IMAGE_FILE_MACHINE_I386 (0x14C)
-; CHECK: NumberOfSections = 2
-; CHECK: TimeDateStamp = {{[0-9]+}}
-; CHECK: PointerToSymbolTable = 0x{{[0-9A-F]+}}
-; CHECK: NumberOfSymbols = 7
-; CHECK: SizeOfOptionalHeader = 0
-; CHECK: Characteristics = 0x0
-; CHECK: Sections = [
-; CHECK: 1 = {
-; CHECK: Name = .text
-; CHECK: VirtualSize = 0
-; CHECK: VirtualAddress = 0
-; CHECK: SizeOfRawData = {{[0-9]+}}
-; CHECK: PointerToRawData = 0x{{[0-9A-F]+}}
-; CHECK: PointerToRelocations = 0x{{[0-9A-F]+}}
-; CHECK: PointerToLineNumbers = 0x0
-; CHECK: NumberOfRelocations = 6
-; 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: 83 EC 04 C7 04 24 00 00 - 00 00 E8 00 00 00 00 C7 |.....$..........|
-; CHECK: 04 24 07 00 00 00 E8 00 - 00 00 00 C7 04 24 10 00 |.$...........$..|
-; CHECK: 00 00 E8 00 00 00 00 31 - C0 83 C4 04 C3 00 00 00 |.......1........|
-; CHECK: Relocations = [
-; CHECK: 0 = {
-; CHECK: VirtualAddress = 0x6
-; CHECK: SymbolTableIndex = 2
-; CHECK: Type = IMAGE_REL_I386_DIR32 (6)
-; CHECK: SymbolName = .data
-; CHECK: }
-; CHECK: 1 = {
-; CHECK: VirtualAddress = 0xB
-; CHECK: SymbolTableIndex = 5
-; CHECK: Type = IMAGE_REL_I386_REL32 (20)
-; CHECK: SymbolName = _printf
-; CHECK: }
-; CHECK: 2 = {
-; CHECK: VirtualAddress = 0x12
-; CHECK: SymbolTableIndex = 2
-; CHECK: Type = IMAGE_REL_I386_DIR32 (6)
-; CHECK: SymbolName = .data
-; CHECK: }
-; CHECK: 3 = {
-; CHECK: VirtualAddress = 0x17
-; CHECK: SymbolTableIndex = 6
-; CHECK: Type = IMAGE_REL_I386_REL32 (20)
-; CHECK: SymbolName = _puts
-; CHECK: }
-; CHECK: 4 = {
-; CHECK: VirtualAddress = 0x1E
-; CHECK: SymbolTableIndex = 2
-; CHECK: Type = IMAGE_REL_I386_DIR32 (6)
-; CHECK: SymbolName = .data
-; CHECK: }
-; CHECK: 5 = {
-; CHECK: VirtualAddress = 0x23
-; CHECK: SymbolTableIndex = 6
-; CHECK: Type = IMAGE_REL_I386_REL32 (20)
-; CHECK: SymbolName = _puts
-; CHECK: }
-; CHECK: ]
-; CHECK: }
-; CHECK: 2 = {
-; CHECK: Name = .data
-; CHECK: VirtualSize = 0
-; CHECK: VirtualAddress = 0
-; CHECK: SizeOfRawData = {{[0-9]+}}
-; CHECK: PointerToRawData = 0x{{[0-9A-F]+}}
-; CHECK: PointerToRelocations = 0x0
-; CHECK: PointerToLineNumbers = 0x0
-; CHECK: NumberOfRelocations = 0
-; CHECK: NumberOfLineNumbers = 0
-; CHECK: Charateristics = 0xC0500040
-; CHECK: IMAGE_SCN_CNT_INITIALIZED_DATA
-; CHECK: IMAGE_SCN_ALIGN_16BYTES
-; CHECK: IMAGE_SCN_MEM_READ
-; CHECK: IMAGE_SCN_MEM_WRITE
-; CHECK: SectionData =
-; CHECK: 48 65 6C 6C 6F 20 00 57 - 6F 72 6C 64 21 00 00 00 |Hello .World!...|
-; CHECK: 49 27 6D 20 54 68 65 20 - 4C 61 73 74 20 4C 69 6E |I'm The Last Lin|
-; CHECK: 65 2E 00 |e..|
-; 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: 30 00 00 00 06 00 00 00 - 00 00 00 00 01 00 00 00 |0...............|
-; CHECK: 00 00 |..|
-
-; CHECK: }
-; CHECK: 2 = {
-; 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: 23 00 00 00 00 00 00 00 - 00 00 00 00 02 00 00 00 |#...............|
-; CHECK: 00 00 |..|
-
-; CHECK: }
-; CHECK: 4 = {
-; CHECK: Name = _main
-; CHECK: Value = 0
-; CHECK: SectionNumber = 1
-; CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0)
-; CHECK: ComplexType = IMAGE_SYM_DTYPE_FUNCTION (2)
-; CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2)
-; CHECK: NumberOfAuxSymbols = 0
-; CHECK: AuxillaryData =
-
-; CHECK: 5 = {
-; 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: 6 = {
-; CHECK: Name = _puts
-; 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: }
Added: llvm/trunk/test/MC/COFF/symbol-fragment-offset.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/COFF/symbol-fragment-offset.s?rev=116150&view=auto
==============================================================================
--- llvm/trunk/test/MC/COFF/symbol-fragment-offset.s (added)
+++ llvm/trunk/test/MC/COFF/symbol-fragment-offset.s Sat Oct 9 06:01:07 2010
@@ -0,0 +1,187 @@
+// The purpose of this test is to see if the COFF object writer is emitting the
+// proper relocations for multiple pieces of data in a single data fragment.
+
+// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | coff-dump.py | FileCheck %s
+// I WOULD RUN, BUT THIS FAILS: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s
+
+.def _main;
+ .scl 2;
+ .type 32;
+ .endef
+ .text
+ .globl _main
+ .align 16, 0x90
+_main: # @main
+# BB#0: # %entry
+ subl $4, %esp
+ movl $L_.str0, (%esp)
+ calll _printf
+ movl $L_.str1, (%esp)
+ calll _puts
+ movl $L_.str2, (%esp)
+ calll _puts
+ xorl %eax, %eax
+ addl $4, %esp
+ ret
+
+ .data
+L_.str0: # @.str0
+ .asciz "Hello "
+
+L_.str1: # @.str1
+ .asciz "World!"
+
+ .align 16 # @.str2
+L_.str2:
+ .asciz "I'm The Last Line."
+
+// CHECK: {
+// CHECK: MachineType = IMAGE_FILE_MACHINE_I386 (0x14C)
+// CHECK: NumberOfSections = 2
+// CHECK: TimeDateStamp = {{[0-9]+}}
+// CHECK: PointerToSymbolTable = 0x{{[0-9A-F]+}}
+// CHECK: NumberOfSymbols = 7
+// CHECK: SizeOfOptionalHeader = 0
+// CHECK: Characteristics = 0x0
+// CHECK: Sections = [
+// CHECK: 1 = {
+// CHECK: Name = .text
+// CHECK: VirtualSize = 0
+// CHECK: VirtualAddress = 0
+// CHECK: SizeOfRawData = {{[0-9]+}}
+// CHECK: PointerToRawData = 0x{{[0-9A-F]+}}
+// CHECK: PointerToRelocations = 0x{{[0-9A-F]+}}
+// CHECK: PointerToLineNumbers = 0x0
+// CHECK: NumberOfRelocations = 6
+// 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: 83 EC 04 C7 04 24 00 00 - 00 00 E8 00 00 00 00 C7 |.....$..........|
+// CHECK: 04 24 07 00 00 00 E8 00 - 00 00 00 C7 04 24 10 00 |.$...........$..|
+// CHECK: 00 00 E8 00 00 00 00 31 - C0 83 C4 04 C3 00 00 00 |.......1........|
+// CHECK: Relocations = [
+// CHECK: 0 = {
+// CHECK: VirtualAddress = 0x6
+// CHECK: SymbolTableIndex = 2
+// CHECK: Type = IMAGE_REL_I386_DIR32 (6)
+// CHECK: SymbolName = .data
+// CHECK: }
+// CHECK: 1 = {
+// CHECK: VirtualAddress = 0xB
+// CHECK: SymbolTableIndex = 5
+// CHECK: Type = IMAGE_REL_I386_REL32 (20)
+// CHECK: SymbolName = _printf
+// CHECK: }
+// CHECK: 2 = {
+// CHECK: VirtualAddress = 0x12
+// CHECK: SymbolTableIndex = 2
+// CHECK: Type = IMAGE_REL_I386_DIR32 (6)
+// CHECK: SymbolName = .data
+// CHECK: }
+// CHECK: 3 = {
+// CHECK: VirtualAddress = 0x17
+// CHECK: SymbolTableIndex = 6
+// CHECK: Type = IMAGE_REL_I386_REL32 (20)
+// CHECK: SymbolName = _puts
+// CHECK: }
+// CHECK: 4 = {
+// CHECK: VirtualAddress = 0x1E
+// CHECK: SymbolTableIndex = 2
+// CHECK: Type = IMAGE_REL_I386_DIR32 (6)
+// CHECK: SymbolName = .data
+// CHECK: }
+// CHECK: 5 = {
+// CHECK: VirtualAddress = 0x23
+// CHECK: SymbolTableIndex = 6
+// CHECK: Type = IMAGE_REL_I386_REL32 (20)
+// CHECK: SymbolName = _puts
+// CHECK: }
+// CHECK: ]
+// CHECK: }
+// CHECK: 2 = {
+// CHECK: Name = .data
+// CHECK: VirtualSize = 0
+// CHECK: VirtualAddress = 0
+// CHECK: SizeOfRawData = {{[0-9]+}}
+// CHECK: PointerToRawData = 0x{{[0-9A-F]+}}
+// CHECK: PointerToRelocations = 0x0
+// CHECK: PointerToLineNumbers = 0x0
+// CHECK: NumberOfRelocations = 0
+// CHECK: NumberOfLineNumbers = 0
+// CHECK: Charateristics = 0xC0500040
+// CHECK: IMAGE_SCN_CNT_INITIALIZED_DATA
+// CHECK: IMAGE_SCN_ALIGN_16BYTES
+// CHECK: IMAGE_SCN_MEM_READ
+// CHECK: IMAGE_SCN_MEM_WRITE
+// CHECK: SectionData =
+// CHECK: 48 65 6C 6C 6F 20 00 57 - 6F 72 6C 64 21 00 00 00 |Hello .World!...|
+// CHECK: 49 27 6D 20 54 68 65 20 - 4C 61 73 74 20 4C 69 6E |I'm The Last Lin|
+// CHECK: 65 2E 00 |e..|
+// 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: 30 00 00 00 06 00 00 00 - 00 00 00 00 01 00 00 00 |0...............|
+// CHECK: 00 00 |..|
+
+// CHECK: }
+// CHECK: 2 = {
+// 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: 23 00 00 00 00 00 00 00 - 00 00 00 00 02 00 00 00 |#...............|
+// CHECK: 00 00 |..|
+
+// CHECK: }
+// CHECK: 4 = {
+// CHECK: Name = _main
+// CHECK: Value = 0
+// CHECK: SectionNumber = 1
+// CHECK: SimpleType = IMAGE_SYM_TYPE_NULL (0)
+// CHECK: ComplexType = IMAGE_SYM_DTYPE_FUNCTION (2)
+// CHECK: StorageClass = IMAGE_SYM_CLASS_EXTERNAL (2)
+// CHECK: NumberOfAuxSymbols = 0
+// CHECK: AuxillaryData =
+
+// CHECK: 5 = {
+// 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: 6 = {
+// CHECK: Name = _puts
+// 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: }
More information about the llvm-commits
mailing list