Imported Upstream version 5.18.0.207

Former-commit-id: 3b152f462918d427ce18620a2cbe4f8b79650449
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-11-17 08:23:10 +00:00
parent 8e12397d70
commit eb85e2fc17
28480 changed files with 72 additions and 3866936 deletions

View File

@@ -1,3 +0,0 @@
if not 'ARM' in config.root.targets:
config.unsupported = True

View File

@@ -1,106 +0,0 @@
// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s -o - \
// RUN: | llvm-readobj -t -r | FileCheck %s
local1:
external_aliased_to_local = local1
.globl global_aliased_to_external
global_aliased_to_external = external1
.globl global_aliased_to_local
local2:
global_aliased_to_local = local2
.weak weak_aliased_to_external
weak_aliased_to_external = external2
// Generate relocs against the above aliases.
.long external_aliased_to_local
.long global_aliased_to_external
.long global_aliased_to_local
.long weak_aliased_to_external
// CHECK: Relocations [
// CHECK: 0x0 IMAGE_REL_I386_DIR32 external_aliased_to_local
// CHECK: 0x4 IMAGE_REL_I386_DIR32 external1
// CHECK: 0x8 IMAGE_REL_I386_DIR32 global_aliased_to_local
// CHECK: 0xC IMAGE_REL_I386_DIR32 external2
// CHECK: ]
// CHECK: Symbols [
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: .text
// CHECK-NEXT: Value: 0
// CHECK-NEXT: Section: .text (1)
// CHECK-NEXT: BaseType: Null (0x0)
// CHECK-NEXT: ComplexType: Null (0x0)
// CHECK-NEXT: StorageClass: Static (0x3)
// CHECK-NEXT: AuxSymbolCount: 1
// CHECK: }
// CHECK: Symbol {
// CHECK: Name: local1
// CHECK-NEXT: Value: 0
// CHECK-NEXT: Section: .text (1)
// CHECK-NEXT: BaseType: Null (0x0)
// CHECK-NEXT: ComplexType: Null (0x0)
// CHECK-NEXT: StorageClass: Static (0x3)
// CHECK-NEXT: AuxSymbolCount: 0
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK: Name: global_aliased_to_external
// CHECK-NEXT: Value: 0
// CHECK-NEXT: Section: IMAGE_SYM_UNDEFINED (0)
// CHECK-NEXT: BaseType: Null (0x0)
// CHECK-NEXT: ComplexType: Null (0x0)
// CHECK-NEXT: StorageClass: External (0x2)
// CHECK-NEXT: AuxSymbolCount: 0
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: external1
// CHECK-NEXT: Value: 0
// CHECK-NEXT: Section: IMAGE_SYM_UNDEFINED (0)
// CHECK-NEXT: BaseType: Null (0x0)
// CHECK-NEXT: ComplexType: Null (0x0)
// CHECK-NEXT: StorageClass: External (0x2)
// CHECK-NEXT: AuxSymbolCount: 0
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: global_aliased_to_local
// CHECK-NEXT: Value: 0
// CHECK-NEXT: Section: .text (1)
// CHECK-NEXT: BaseType: Null (0x0)
// CHECK-NEXT: ComplexType: Null (0x0)
// CHECK-NEXT: StorageClass: External (0x2)
// CHECK-NEXT: AuxSymbolCount: 0
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: local2
// CHECK-NEXT: Value: 0
// CHECK-NEXT: Section: .text (1)
// CHECK-NEXT: BaseType: Null (0x0)
// CHECK-NEXT: ComplexType: Null (0x0)
// CHECK-NEXT: StorageClass: Static (0x3)
// CHECK-NEXT: AuxSymbolCount: 0
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: weak_aliased_to_external
// CHECK-NEXT: Value: 0
// CHECK-NEXT: Section: IMAGE_SYM_UNDEFINED (0)
// CHECK-NEXT: BaseType: Null (0x0)
// CHECK-NEXT: ComplexType: Null (0x0)
// CHECK-NEXT: StorageClass: WeakExternal (0x69)
// CHECK-NEXT: AuxSymbolCount: 1
// CHECK-NEXT: AuxWeakExternal {
// CHECK-NEXT: Linked: external2
// CHECK-NEXT: Search: Library (0x2)
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: external2
// CHECK-NEXT: Value: 0
// CHECK-NEXT: Section: IMAGE_SYM_UNDEFINED (0)
// CHECK-NEXT: BaseType: Null (0x0)
// CHECK-NEXT: ComplexType: Null (0x0)
// CHECK-NEXT: StorageClass: External (0x2)
// CHECK-NEXT: AuxSymbolCount: 0
// CHECK-NEXT: }
// CHECK-NEXT: ]

View File

@@ -1,54 +0,0 @@
// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 -mcpu=pentiumpro %s | llvm-readobj -s -sd | FileCheck %s
// Test that we get optimal nops in text
.text
f0:
.long 0
.align 8, 0x90
.long 0
.align 8
// But not in another section
.data
.long 0
.align 8, 0x90
.long 0
.align 8
//CHECK: Name: .text
//CHECK-NEXT: VirtualSize
//CHECK-NEXT: VirtualAddress
//CHECK-NEXT: RawDataSize: 16
//CHECK-NEXT: PointerToRawData
//CHECK-NEXT: PointerToRelocations
//CHECK-NEXT: PointerToLineNumbers
//CHECK-NEXT: RelocationCount
//CHECK-NEXT: LineNumberCount
//CHECK-NEXT: Characteristics [ (0x60400020)
//CHECK-NEXT: IMAGE_SCN_ALIGN_8BYTES
//CHECK-NEXT: IMAGE_SCN_CNT_CODE
//CHECK-NEXT: IMAGE_SCN_MEM_EXECUTE
//CHECK-NEXT: IMAGE_SCN_MEM_READ
//CHECK-NEXT: ]
//CHECK-NEXT: SectionData (
//CHECK-NEXT: 0000: 00000000 0F1F4000 00000000 0F1F4000
//CHECK-NEXT: )
//CHECK: Name: .data
//CHECK-NEXT: VirtualSize:
//CHECK-NEXT: VirtualAddress:
//CHECK-NEXT: RawDataSize: 16
//CHECK-NEXT: PointerToRawData:
//CHECK-NEXT: PointerToRelocations:
//CHECK-NEXT: PointerToLineNumbers:
//CHECK-NEXT: RelocationCount:
//CHECK-NEXT: LineNumberCount:
//CHECK-NEXT: Characteristics [ (0xC0400040)
//CHECK-NEXT: IMAGE_SCN_ALIGN_8BYTES
//CHECK-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA
//CHECK-NEXT: IMAGE_SCN_MEM_READ
//CHECK-NEXT: IMAGE_SCN_MEM_WRITE
//CHECK-NEXT: ]
//CHECK-NEXT: SectionData (
//CHECK-NEXT: 0000: 00000000 90909090 00000000 00000000
//CHECK-NEXT: )

View File

@@ -1,6 +0,0 @@
// RUN: not llvm-mc -filetype=obj -triple i386-pc-win32 %s 2>&1 | FileCheck %s
.data
_x:
// CHECK: [[@LINE+1]]:{{[0-9]+}}: error: symbol '__ImageBase' can not be undefined in a subtraction expression
.long _x-__ImageBase

View File

@@ -1,136 +0,0 @@
// This test checks that the COFF object emitter works for the most basic
// programs.
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | llvm-readobj -h -s -sr -sd -t | FileCheck %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)
call _printf
xorl %eax, %eax
addl $4, %esp
ret
.data
.L_.str: # @.str
.asciz "Hello World"
// CHECK: ImageFileHeader {
// CHECK: Machine: IMAGE_FILE_MACHINE_AMD64
// CHECK: SectionCount: 3
// CHECK: TimeDateStamp: {{[0-9]+}}
// CHECK: PointerToSymbolTable: 0x{{[0-9A-F]+}}
// CHECK: SymbolCount: 8
// CHECK: OptionalHeaderSize: 0
// CHECK: Characteristics [ (0x0)
// CHECK: ]
// CHECK: }
// CHECK: Sections [
// CHECK: Section {
// CHECK: Number: [[TextNum:[0-9]+]]
// CHECK: Name: .text
// CHECK: VirtualSize: 0
// CHECK: VirtualAddress: 0
// CHECK: RawDataSize: [[TextSize:[0-9]+]]
// CHECK: PointerToRawData: 0x{{[0-9A-F]+}}
// CHECK: PointerToRelocations: 0x{{[0-9A-F]+}}
// CHECK: PointerToLineNumbers: 0x0
// CHECK: RelocationCount: 2
// CHECK: LineNumberCount: 0
// CHECK: Characteristics [ (0x60500020)
// CHECK: IMAGE_SCN_ALIGN_16BYTES
// CHECK: IMAGE_SCN_CNT_CODE
// CHECK: IMAGE_SCN_MEM_EXECUTE
// CHECK: IMAGE_SCN_MEM_READ
// CHECK: ]
// CHECK: Relocations [
// CHECK: 0x{{[0-9A-F]+}} IMAGE_REL_AMD64_ADDR32 .data
// CHECK: 0x{{[0-9A-F]+}} IMAGE_REL_AMD64_REL32 _printf
// CHECK: ]
// CHECK: }
// CHECK: Section {
// CHECK: Number: [[DataNum:[0-9]+]]
// CHECK: Name: .data
// CHECK: VirtualSize: 0
// CHECK: VirtualAddress: 0
// CHECK: RawDataSize: [[DataSize:[0-9]+]]
// CHECK: PointerToRawData: 0x{{[0-9A-F]+}}
// CHECK: PointerToRelocations: 0x0
// CHECK: PointerToLineNumbers: 0x0
// CHECK: RelocationCount: 0
// CHECK: LineNumberCount: 0
// CHECK: Characteristics [ (0xC0300040)
// CHECK: IMAGE_SCN_ALIGN_4BYTES
// CHECK: IMAGE_SCN_CNT_INITIALIZED_DATA
// CHECK: IMAGE_SCN_MEM_READ
// CHECK: IMAGE_SCN_MEM_WRITE
// CHECK: ]
// CHECK: Relocations [
// CHECK: ]
// CHECK: SectionData (
// CHECK: 0000: 48656C6C 6F20576F 726C6400 |Hello World.|
// CHECK: )
// CHECK: }
// CHECK: ]
// CHECK: Symbols [
// CHECK: Symbol {
// CHECK: Name: .text
// CHECK: Value: 0
// CHECK: Section: .text
// CHECK: BaseType: Null
// CHECK: ComplexType: Null
// CHECK: StorageClass: Static
// CHECK: AuxSymbolCount: 1
// CHECK: AuxSectionDef {
// CHECK: Length: [[TextSize]]
// CHECK: RelocationCount: 2
// CHECK: LineNumberCount: 0
// CHECK: Checksum: 0x8E1B6D20
// CHECK: Number: [[TextNum]]
// CHECK: Selection: 0x0
// CHECK: }
// CHECK: }
// CHECK: Symbol {
// CHECK: Name: .data
// CHECK: Value: 0
// CHECK: Section: .data
// CHECK: BaseType: Null
// CHECK: ComplexType: Null
// CHECK: StorageClass: Static
// CHECK: AuxSymbolCount: 1
// CHECK: AuxSectionDef {
// CHECK: Length: [[DataSize]]
// CHECK: RelocationCount: 0
// CHECK: LineNumberCount: 0
// CHECK: Checksum: 0x2B95CA92
// CHECK: Number: [[DataNum]]
// CHECK: Selection: 0x0
// CHECK: }
// CHECK: }
// CHECK: Symbol {
// CHECK: Name: _main
// CHECK: Value: 0
// CHECK: Section: .text
// CHECK: BaseType: Null
// CHECK: ComplexType: Function
// CHECK: StorageClass: External
// CHECK: AuxSymbolCount: 0
// CHECK: }
// CHECK: Symbol {
// CHECK: Name: _printf
// CHECK: Value: 0
// CHECK: Section: IMAGE_SYM_UNDEFINED (0)
// CHECK: BaseType: Null
// CHECK: ComplexType: Null
// CHECK: StorageClass: External
// CHECK: AuxSymbolCount: 0
// CHECK: }
// CHECK: ]

View File

@@ -1,136 +0,0 @@
// This test checks that the COFF object emitter works for the most basic
// programs.
// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -h -s -sr -sd -t | FileCheck %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)
call _printf
xorl %eax, %eax
addl $4, %esp
ret
.data
L_.str: # @.str
.asciz "Hello World"
// CHECK: ImageFileHeader {
// CHECK: Machine: IMAGE_FILE_MACHINE_I386
// CHECK: SectionCount: 3
// CHECK: TimeDateStamp: {{[0-9]+}}
// CHECK: PointerToSymbolTable: 0x{{[0-9A-F]+}}
// CHECK: SymbolCount: 8
// CHECK: OptionalHeaderSize: 0
// CHECK: Characteristics [ (0x0)
// CHECK: ]
// CHECK: }
// CHECK: Sections [
// CHECK: Section {
// CHECK: Number: [[TextNum:[0-9]+]]
// CHECK: Name: .text
// CHECK: VirtualSize: 0
// CHECK: VirtualAddress: 0
// CHECK: RawDataSize: {{[0-9]+}}
// CHECK: PointerToRawData: 0x{{[0-9A-F]+}}
// CHECK: PointerToRelocations: 0x{{[0-9A-F]+}}
// CHECK: PointerToLineNumbers: 0x0
// CHECK: RelocationCount: 2
// CHECK: LineNumberCount: 0
// CHECK: Characteristics [ (0x60500020)
// CHECK: IMAGE_SCN_ALIGN_16BYTES
// CHECK: IMAGE_SCN_CNT_CODE
// CHECK: IMAGE_SCN_MEM_EXECUTE
// CHECK: IMAGE_SCN_MEM_READ
// CHECK: ]
// CHECK: Relocations [
// CHECK: 0x{{[0-9A-F]+}} IMAGE_REL_I386_DIR32 .data
// CHECK: 0x{{[0-9A-F]+}} IMAGE_REL_I386_REL32 _printf
// CHECK: ]
// CHECK: }
// CHECK: Section {
// CHECK: Number: [[DataNum:[0-9]+]]
// CHECK: Name: .data
// CHECK: VirtualSize: 0
// CHECK: VirtualAddress: 0
// CHECK: RawDataSize: {{[0-9]+}}
// CHECK: PointerToRawData: 0x{{[0-9A-F]+}}
// CHECK: PointerToRelocations: 0x0
// CHECK: PointerToLineNumbers: 0x0
// CHECK: RelocationCount: 0
// CHECK: LineNumberCount: 0
// CHECK: Characteristics [ (0xC0300040)
// CHECK: IMAGE_SCN_ALIGN_4BYTES
// CHECK: IMAGE_SCN_CNT_INITIALIZED_DATA
// CHECK: IMAGE_SCN_MEM_READ
// CHECK: IMAGE_SCN_MEM_WRITE
// CHECK: ]
// CHECK: Relocations [
// CHECK: ]
// CHECK: SectionData (
// CHECK: 0000: 48656C6C 6F20576F 726C6400 |Hello World.|
// CHECK: )
// CHECK: }
// CHECK: ]
// CHECK: Symbols [
// CHECK: Symbol {
// CHECK: Name: .text
// CHECK: Value: 0
// CHECK: Section: .text
// CHECK: BaseType: Null
// CHECK: ComplexType: Null
// CHECK: StorageClass: Static
// CHECK: AuxSymbolCount: 1
// CHECK: AuxSectionDef {
// CHECK: Length: 21
// CHECK: RelocationCount: 2
// CHECK: LineNumberCount: 0
// CHECK: Checksum: 0xC6461CBE
// CHECK: Number: 1
// CHECK: Selection: 0x0
// CHECK: }
// CHECK: }
// CHECK: Symbol {
// CHECK: Name: .data
// CHECK: Value: 0
// CHECK: Section: .data
// CHECK: BaseType: Null
// CHECK: ComplexType: Null
// CHECK: StorageClass: Static
// CHECK: AuxSymbolCount: 1
// CHECK: AuxSectionDef {
// CHECK: Length: 12
// CHECK: RelocationCount: 0
// CHECK: LineNumberCount: 0
// CHECK: Checksum: 0x2B95CA92
// CHECK: Number: 2
// CHECK: Selection: 0x0
// CHECK: }
// CHECK: }
// CHECK: Symbol {
// CHECK: Name: _main
// CHECK: Value: 0
// CHECK: Section: .text
// CHECK: BaseType: Null
// CHECK: ComplexType: Function
// CHECK: StorageClass: External
// CHECK: AuxSymbolCount: 0
// CHECK: }
// CHECK: Symbol {
// CHECK: Name: _printf
// CHECK: Value: 0
// CHECK: Section: IMAGE_SYM_UNDEFINED (0)
// CHECK: BaseType: Null
// CHECK: ComplexType: Null
// CHECK: StorageClass: External
// CHECK: AuxSymbolCount: 0
// CHECK: }
// CHECK: ]

View File

@@ -1,26 +0,0 @@
# RUN: python %s | llvm-mc -filetype=obj -triple i686-pc-win32 - | llvm-readobj -h | FileCheck %s
# This test checks that the COFF object emitter can produce objects with
# more than 65279 sections.
# While we only generate 65277 sections, an implicit .text, .data and .bss will
# also be emitted. This brings the total to 65280.
num_sections = 65277
# CHECK: ImageFileHeader {
# CHECK-NEXT: Machine: IMAGE_FILE_MACHINE_I386
# CHECK-NEXT: SectionCount: 65280
# CHECK-NEXT: TimeDateStamp: {{[0-9]+}}
# CHECK-NEXT: PointerToSymbolTable: 0x{{[0-9A-F]+}}
# CHECK-NEXT: SymbolCount: 195837
# CHECK-NEXT: OptionalHeaderSize: 0
# CHECK-NEXT: Characteristics [ (0x0)
# CHECK-NEXT: ]
# CHECK-NEXT: }
for i in range(0, num_sections):
print(""" .section .bss,"bw",discard,_b%d
.globl _b%d # @b%d
_b%d:
.byte 0 # 0x0
""" % (i, i, i, i))

View File

@@ -1,15 +0,0 @@
// The purpose of this test is to verify that bss sections are emitted correctly.
// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -s | FileCheck %s
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s | llvm-readobj -s | FileCheck %s
.bss
.globl _g0
.align 4
_g0:
.long 0
// CHECK: Name: .bss
// CHECK-NEXT: VirtualSize: 0
// CHECK-NEXT: VirtualAddress: 0
// CHECK-NEXT: RawDataSize: 4

View File

@@ -1,10 +0,0 @@
; RUN: llc -mtriple i386-pc-win32 < %s | FileCheck %s
%struct.foo = type { i32, i32 }
@"\01?thingy@@3Ufoo@@B" = global %struct.foo zeroinitializer, align 4
; CHECK: .bss
$thingy_linkonce = comdat any
@thingy_linkonce = linkonce_odr global %struct.foo zeroinitializer, comdat, align 4
; CHECK: .section .bss,"bw",discard,_thingy_linkonce

View File

@@ -1,57 +0,0 @@
# RUN: llvm-mc -triple i686-windows-gnu -filetype obj -o - %s \
# RUN: | llvm-readobj -coff-directives -symbols | FileCheck %s
# NOTE: this test checks multiple things:
# - that -aligncomm is not emitted for 1-byte alignment
# - that -aligncomm is emitted for the various alignments (greater than 1)
# - that the alignment is represented as a log_2 of the alignment
# - that the section switching occurs correctly
# - that functions after the switch also are emitted into the correct section
.text
.def _a
.scl 3
.type 32
.endef
_a:
ret
.data
.comm _s_1,4,0 # @s_1
.comm _s_2,4,1 # @s_2
.comm _s_4,4,2 # @s_3
.comm _s_8,4,3 # @s_4
.comm _small_but_overaligned,1,3 # @s_4
.text
.def _b
.scl 3
.type 32
.endef
_b:
ret
# CHECK-NOT: -aligncomm:"_s_1",0
# CHECK: Symbols [
# CHECK: Symbol {
# CHECK: Name: _a
# CHECK: Section: .text (1)
# CHECK: }
# CHECK: Symbol {
# CHECK: Name: _small_but_overaligned
# CHECK-NEXT:Value: 1
# CHECK-NEXT:Section: IMAGE_SYM_UNDEFINED (0)
# CHECK: }
# CHECK: Symbol {
# CHECK: Name: _b
# CHECK: Section: .text (1)
# CHECK: }
# CHECK: ]
# CHECK: Directive(s): -aligncomm:"_s_2",1 -aligncomm:"_s_4",2 -aligncomm:"_s_8",3 -aligncomm:"_small_but_overaligned",3

View File

@@ -1,13 +0,0 @@
; RUN: llc -mtriple i386-pc-mingw32 < %s | FileCheck %s
@a = internal global i8 0, align 1
@b = internal global double 0.000000e+00, align 8
@c = common global i8 0, align 1
@d = common global double 0.000000e+00, align 8
; .lcomm uses byte alignment
; CHECK: .lcomm _a,1
; CHECK: .lcomm _b,8,8
; .comm uses log2 alignment
; CHECK: .comm _c,1,0
; CHECK: .comm _d,8,3

View File

@@ -1,37 +0,0 @@
// RUN: llvm-mc -filetype=obj -triple i686-pc-win32 %s | llvm-readobj -t | FileCheck %s
.lcomm _a,4,4
.comm _b, 4, 2
// _c has size 1 but align 32, the value field is the max of size and align.
.comm _c, 1, 5
// CHECK: Symbol {
// CHECK: Name: _a
// CHECK-NEXT: Value:
// CHECK-NEXT: Section: .bss
// CHECK-NEXT: BaseType: Null
// CHECK-NEXT: ComplexType: Null
// CHECK-NEXT: StorageClass: Static
// CHECK-NEXT: AuxSymbolCount: 0
// CHECK-NEXT: }
// CHECK: Symbol {
// CHECK: Name: _b
// CHECK-NEXT: Value: 4
// CHECK-NEXT: Section: IMAGE_SYM_UNDEFINED (0)
// CHECK-NEXT: BaseType: Null
// CHECK-NEXT: ComplexType: Null
// CHECK-NEXT: StorageClass: External
// CHECK-NEXT: AuxSymbolCount: 0
// CHECK-NEXT: }
// CHECK: Symbol {
// CHECK: Name: _c
// CHECK-NEXT: Value: 32
// CHECK-NEXT: Section: IMAGE_SYM_UNDEFINED (0)
// CHECK-NEXT: BaseType: Null
// CHECK-NEXT: ComplexType: Null
// CHECK-NEXT: StorageClass: External
// CHECK-NEXT: AuxSymbolCount: 0
// CHECK-NEXT: }

View File

@@ -1,11 +0,0 @@
; RUN: llc -mtriple x86_64-pc-windows-msvc < %s | FileCheck %s
define void @f() {
ret void
}
@ptr = constant void ()* @f, section ".CRT$XLB", align 8
; CHECK: .section .CRT$XLB,"dr"
@weak_array = weak_odr unnamed_addr constant [1 x i8*] [i8* bitcast (void ()* @f to i8*)]
; CHECK: .section .rdata,"dr"

View File

@@ -1,12 +0,0 @@
// RUN: not llvm-mc -filetype=obj -triple x86_64-pc-win32 %s -o /dev/null 2>&1 | FileCheck %s
// CHECK: [[@LINE+1]]:{{[0-9]+}}: error: Cannot represent this expression
.byte foo - .
// CHECK: [[@LINE+1]]:{{[0-9]+}}: error: Cannot represent this expression
.short foo - .
// CHECK: [[@LINE+1]]:{{[0-9]+}}: error: Cannot represent this expression
.quad foo - .

View File

@@ -1,40 +0,0 @@
; Verify the assembler produces the expected expressions
; RUN: llc -mtriple=x86_64-pc-win32 %s -o - | FileCheck %s
;;;; some globals
@g1 = constant i32 1;
@g2 = constant i32 2;
@g3 = constant i32 3;
@g4 = constant i32 4;
@__ImageBase = external global i64*;
;;;; cross-section relative relocations
; CHECK: .quad (g3-t1)+4
@t1 = global i64 add(i64 sub(i64 ptrtoint(i32* @g3 to i64), i64 ptrtoint(i64* @t1 to i64)), i64 4), section ".fix"
; CHECK: .quad g3-t2
@t2 = global i64 sub(i64 ptrtoint(i32* @g3 to i64), i64 ptrtoint(i64* @t2 to i64)), section ".fix"
; CHECK: .quad (g3-t3)-4
@t3 = global i64 sub(i64 sub(i64 ptrtoint(i32* @g3 to i64), i64 ptrtoint(i64* @t3 to i64)), i64 4), section ".fix"
; CHECK: .long g3-t4
@t4 = global i32 trunc(i64 sub(i64 ptrtoint(i32* @g3 to i64), i64 ptrtoint(i32* @t4 to i64)) to i32), section ".fix"
;;;; image base relocation
; CHECK: .long g3@IMGREL{{$}}
@t5 = global i32 trunc(i64 sub(i64 ptrtoint(i32* @g3 to i64), i64 ptrtoint(i64** @__ImageBase to i64)) to i32), section ".fix"
; CHECK: .long g3@IMGREL+4{{$}}
@t6 = global i32 trunc(i64 sub(i64 ptrtoint(i32* getelementptr (i32, i32* @g3, i32 1) to i64), i64 ptrtoint(i64** @__ImageBase to i64)) to i32), section ".fix"
;;;; cross-section relative with source offset
%struct.EEType = type { [2 x i8], i64, i32}
; CHECK: .long (g3-t7)-16
@t7 = global %struct.EEType {
[2 x i8] c"\01\02",
i64 256,
i32 trunc(i64 sub(i64 ptrtoint(i32* @g3 to i64), i64 ptrtoint(i32* getelementptr inbounds (%struct.EEType, %struct.EEType* @t7, i32 0, i32 2) to i64)) to i32 )
}, section ".fix"

View File

@@ -1,107 +0,0 @@
// Verify the .fix data section conveys the right offsets and the right relocations
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-win32 %s -o - | llvm-readobj -relocations -expand-relocs -sections -section-data | FileCheck %s --check-prefix=READOBJ
.text
.section .rdata,"dr"
.globl g1 # @g1
.align 4
g1:
.long 1 # 0x1
.globl g2 # @g2
.align 4
g2:
.long 2 # 0x2
.globl g3 # @g3
.align 4
g3:
.long 3 # 0x3
.globl g4 # @g4
.align 4
g4:
.long 4 # 0x4
.section .fix,"dw"
.globl t1 # @t1
.align 8
t1:
.globl t2 # @t2
.align 8
t2:
.globl t3 # @t3
.align 8
t3:
.globl t4 # @t4
.align 4
t4:
.long g3-t4
.globl t5 # @t5
.align 4
t5:
.long g3@IMGREL
.globl t6 # @t6
.align 16
t6:
.ascii "\001\002"
.zero 6
.quad 256 # 0x100
.long g3-(t6+16)
.zero 4
.long foobar - .
// READOBJ: Section {
// READOBJ: Number:
// READOBJ: Name: .fix (2E 66 69 78 00 00 00 00)
// READOBJ-NEXT: VirtualSize: 0x0
// READOBJ-NEXT: VirtualAddress: 0x0
// READOBJ-NEXT: RawDataSize:
// READOBJ-NEXT: PointerToRawData: 0xEC
// READOBJ-NEXT: PointerToRelocations:
// READOBJ-NEXT: PointerToLineNumbers: 0x0
// READOBJ-NEXT: RelocationCount:
// READOBJ-NEXT: LineNumberCount: 0
// READOBJ-NEXT: Characteristics [ (0xC0500040)
// READOBJ-NEXT: IMAGE_SCN_ALIGN_16BYTES (0x500000)
// READOBJ-NEXT: IMAGE_SCN_CNT_INITIALIZED_DATA (0x40)
// READOBJ-NEXT: IMAGE_SCN_MEM_READ (0x40000000)
// READOBJ-NEXT: IMAGE_SCN_MEM_WRITE (0x80000000)
// READOBJ-NEXT: ]
// READOBJ-NEXT: SectionData (
// READOBJ-NEXT: 0000: 04000000 00000000 00000000 00000000 |
// READOBJ-NEXT: 0010: 01020000 00000000 00010000 00000000 |
// READOBJ-NEXT: 0020: 04000000 00000000 04000000 |
// READOBJ-NEXT: )
// READOBJ-NEXT: }
// READOBJ-NEXT: ]
// READOBJ-NEXT: Relocations [
// READOBJ-NEXT: Section (5) .fix {
// READOBJ-NEXT: Relocation {
// READOBJ-NEXT: Offset: 0x0
// READOBJ-NEXT: Type: IMAGE_REL_AMD64_REL32 (4)
// READOBJ-NEXT: Symbol: g3
// READOBJ-NEXT: }
// READOBJ-NEXT: Relocation {
// READOBJ-NEXT: Offset: 0x4
// READOBJ-NEXT: Type: IMAGE_REL_AMD64_ADDR32NB (3)
// READOBJ-NEXT: Symbol: g3
// READOBJ-NEXT: }
// READOBJ-NEXT: Relocation {
// READOBJ-NEXT: Offset: 0x20
// READOBJ-NEXT: Type: IMAGE_REL_AMD64_REL32 (4)
// READOBJ-NEXT: Symbol: g3
// READOBJ-NEXT: }
// READOBJ-NEXT: Relocation {
// READOBJ-NEXT: Offset: 0x28
// READOBJ-NEXT: Type: IMAGE_REL_AMD64_REL32 (4)
// READOBJ-NEXT: Symbol: foobar
// READOBJ-NEXT: }
// READOBJ-NEXT: }
// READOBJ-NEXT:]

View File

@@ -1,45 +0,0 @@
; RUN: llc -mtriple i686-pc-windows-msvc < %s | FileCheck %s
; ModuleID = 'D:\src\scopes\foo.cpp'
source_filename = "D:\5Csrc\5Cscopes\5Cfoo.cpp"
target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
target triple = "i686-pc-windows-msvc19.0.23918"
; Function Attrs: nounwind sspstrong
define i32 @"\01?foo@@YAHXZ"() #0 !dbg !10 {
entry:
ret i32 42, !dbg !14
}
attributes #0 = { nounwind sspstrong "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="pentium4" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!7, !8}
!llvm.ident = !{!9}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 4.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
; One .debug$S section should contain an S_COMPILE3 record that identifies the
; source language and the version of the compiler based on the DICompileUnit.
; CHECK: .section .debug$S,"dr"
; CHECK: .short 4412 # Record kind: S_COMPILE3
; CHECK: .long 1 # Flags and language
; CHECK: .short 7 # CPUType
; CHECK: .short 4 # Frontend version
; CHECK: .short 0
; CHECK: .short 0
; CHECK: .short 0
; CHECK: .short [[BACKEND_VERSION:[0-9]+]] # Backend version
; CHECK: .short 0
; CHECK: .short 0
; CHECK: .short 0
; CHECK: .asciz "clang version 4.0.0 " # Null-terminated compiler version string
; CHECK-NOT: .short 4412 # Record kind: S_COMPILE3
!1 = !DIFile(filename: "D:\5Csrc\5Cscopes\5Cfoo.cpp", directory: "D:\5Csrc\5Cscopes\5Cclang")
!2 = !{}
!7 = !{i32 2, !"CodeView", i32 1}
!8 = !{i32 2, !"Debug Info Version", i32 3}
!9 = !{!"clang version 4.0.0 "}
!10 = distinct !DISubprogram(name: "foo", linkageName: "\01?foo@@YAHXZ", scope: !1, file: !1, line: 1, type: !11, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!11 = !DISubroutineType(types: !12)
!12 = !{!13}
!13 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!14 = !DILocation(line: 2, scope: !10)

View File

@@ -1,129 +0,0 @@
# RUN: llvm-mc -triple=x86_64-pc-win32 -filetype=obj < %s | llvm-readobj -codeview | FileCheck %s
# This tries to test defrange gap edge cases.
# CHECK: LocalSym {
# CHECK: Type: int (0x74)
# CHECK: VarName: p
# CHECK: }
# CHECK-NOT: LocalSym {
# CHECK: DefRangeRegisterSym {
# CHECK-NEXT: Kind: S_DEFRANGE_REGISTER (0x1141)
# CHECK-NEXT: Register: ESI (0x17)
# CHECK-NEXT: MayHaveNoName: 0
# CHECK-NEXT: LocalVariableAddrRange {
# CHECK-NEXT: OffsetStart: .text+0x5
# CHECK-NEXT: ISectStart: 0x0
# CHECK-NEXT: Range: 0x5
# CHECK-NEXT: }
# CHECK-NEXT: LocalVariableAddrGap [
# CHECK-NEXT: GapStartOffset: 0x3
# CHECK-NEXT: Range: 0x1
# CHECK-NEXT: ]
# CHECK-NEXT: }
# CHECK-NEXT: DefRangeRegisterSym {
# CHECK-NEXT: Kind: S_DEFRANGE_REGISTER (0x1141)
# CHECK-NEXT: Register: ESI (0x17)
# CHECK-NEXT: MayHaveNoName: 0
# CHECK-NEXT: LocalVariableAddrRange {
# CHECK-NEXT: OffsetStart: .text+0x10015
# CHECK-NEXT: ISectStart: 0x0
# CHECK-NEXT: Range: 0x6
# CHECK-NEXT: }
# CHECK-NEXT: }
# CHECK-NEXT: DefRangeRegisterSym {
# CHECK-NEXT: Kind: S_DEFRANGE_REGISTER (0x1141)
# CHECK-NEXT: Register: ESI (0x17)
# CHECK-NEXT: MayHaveNoName: 0
# CHECK-NEXT: LocalVariableAddrRange {
# CHECK-NEXT: OffsetStart: .text+0x2001B
# CHECK-NEXT: ISectStart: 0x0
# CHECK-NEXT: Range: 0x1
# CHECK-NEXT: }
# CHECK-NEXT: }
# CHECK-NEXT: DefRangeRegisterSym {
# CHECK-NEXT: Kind: S_DEFRANGE_REGISTER (0x1141)
# CHECK-NEXT: Register: ESI (0x17)
# CHECK-NEXT: MayHaveNoName: 0
# CHECK-NEXT: LocalVariableAddrRange {
# CHECK-NEXT: OffsetStart: .text+0x2001C
# CHECK-NEXT: ISectStart: 0x0
# CHECK-NEXT: Range: 0xF000
# CHECK-NEXT: }
# CHECK-NEXT: LocalVariableAddrGap [
# CHECK-NEXT: GapStartOffset: 0x1
# CHECK-NEXT: Range: 0xEFFE
# CHECK-NEXT: ]
# CHECK-NEXT: }
.text
f: # @f
mov $42, %esi
.Lbegin0:
nop
jmp .Lbegin1
.Lend0:
nop
.Lbegin1:
nop
.Lend1:
.p2align 4
.fill 0x10000, 1, 0x90
mov $42, %esi
.Lbegin2:
nop
jmp .Lbegin3
.Lend2:
.fill 0x10000, 1, 0x90
.Lbegin3:
nop
.Lend3:
# Create a range that is exactly 0xF000 bytes long with a gap in the
# middle.
.Lbegin4:
nop
.Lend4:
.fill 0xeffe, 1, 0x90
.Lbegin5:
nop
.Lend5:
ret
.Lfunc_end0:
.section .debug$S,"dr"
.p2align 2
.long 4 # Debug section magic
.long 241 # Symbol subsection for f
.long .Ltmp15-.Ltmp14 # Subsection size
.Ltmp14:
.short .Ltmp17-.Ltmp16 # Record length
.Ltmp16:
.short 4423 # Record kind: S_GPROC32_ID
.long 0 # PtrParent
.long 0 # PtrEnd
.long 0 # PtrNext
.long .Lfunc_end0-f # Code size
.long 0 # Offset after prologue
.long 0 # Offset before epilogue
.long 4098 # Function type index
.secrel32 f # Function section relative address
.secidx f # Function section index
.byte 0 # Flags
.asciz "f" # Function name
.Ltmp17:
.short .Ltmp19-.Ltmp18 # Record length
.Ltmp18:
.short 4414 # Record kind: S_LOCAL
.long 116 # TypeIndex
.short 0 # Flags
.asciz "p"
.Ltmp19:
.cv_def_range .Lbegin0 .Lend0 .Lbegin1 .Lend1 .Lbegin2 .Lend2 .Lbegin3 .Lend3, "A\021\027\000\000\000"
.cv_def_range .Lbegin4 .Lend4 .Lbegin5 .Lend5, "A\021\027\000\000\000"
.short 2 # Record length
.short 4431 # Record kind: S_PROC_ID_END
.Ltmp15:
.cv_filechecksums # File index to string table offset subsection
.cv_stringtable # String table

View File

@@ -1,98 +0,0 @@
# RUN: llvm-mc -triple=i686-pc-win32 -filetype=obj < %s | llvm-readobj -codeview -codeview-subsection-bytes | FileCheck %s
.text
.def @feat.00;
.scl 3;
.type 0;
.endef
.globl @feat.00
@feat.00 = 1
.def _g;
.scl 2;
.type 32;
.endef
.globl _g
.p2align 4, 0x90
_g: # @g
Lfunc_begin0:
.cv_file 1 "\\usr\\local\\google\\home\\majnemer\\llvm\\src\\<stdin>"
.cv_func_id 0
.cv_loc 0 1 3 0 is_stmt 0 # <stdin>:3:0
# %bb.0: # %entry
pushl %ebp
movl %esp, %ebp
subl $8, %esp
leal -4(%ebp), %eax
Lvar_begin0:
#DEBUG_VALUE: g:x <- %eax
.cv_loc 0 1 4 7 # <stdin>:4:7
movl $0, -4(%ebp)
.cv_loc 0 1 5 3 # <stdin>:5:3
movl %eax, (%esp)
calll _f
.cv_loc 0 1 6 1 # <stdin>:6:1
Lvar_end0:
addl $8, %esp
popl %ebp
retl
Lfunc_end0:
.section .debug$T,"dr"
.long 4 # Debug section magic
.short 6 # Type record length
.short 4609 # Leaf type: LF_ARGLIST
.long 0 # Number of arguments
.short 14 # Type record length
.short 4104 # Leaf type: LF_PROCEDURE
.long 3 # Return type index
.byte 0 # Calling convention
.byte 0 # Function options
.short 0 # # of parameters
.long 4096 # Argument list type index
.short 12 # Type record length
.short 5633 # Leaf type: LF_FUNC_ID
.long 0 # Scope type index
.long 4097 # Function type
.asciz "g" # Function name
.section .debug$S,"dr"
.long 4 # Debug section magic
.long 241 # Symbol subsection for g
.long Ltmp1-Ltmp0 # Subsection size
Ltmp0:
.short Ltmp3-Ltmp2 # Record length
Ltmp2:
.short 4423 # Record kind: S_GPROC32_ID
.long 0 # PtrParent
.long 0 # PtrEnd
.long 0 # PtrNext
.long Lfunc_end0-_g # Code size
.long 0 # Offset after prologue
.long 0 # Offset before epilogue
.long 0 # Function type index
.secrel32 _g # Function section relative address
.secidx _g # Function section index
.byte 0 # Flags
.asciz "g" # Function name
Ltmp3:
.short 2 # Record length
.short 4431 # Record kind: S_PROC_ID_END
.cv_def_range Lvar_begin0 Lvar_end0, "\102\021\374\377\377\377"
# CHECK: DefRangeFramePointerRelSym {
# CHECK: Offset: -4
# CHECK: LocalVariableAddrRange {
# CHECK: OffsetStart: .text+0x9
# CHECK: ISectStart: 0x0
# CHECK: Range: 0xF
# CHECK: }
# CHECK: BlockRelocations [
# CHECK: 0x4 IMAGE_REL_I386_SECREL .text
# CHECK: 0x8 IMAGE_REL_I386_SECTION .text
# CHECK: ]
# CHECK: }
Ltmp1:
.p2align 2
.cv_linetable 0, _g, Lfunc_end0
.cv_filechecksums # File index to string table offset subsection
.cv_stringtable # String table

View File

@@ -1,13 +0,0 @@
# RUN: llvm-mc -filetype=obj -triple i686-pc-win32 < %s | llvm-readobj -codeview - | FileCheck %s
.text
.section .debug$S,"dr"
.p2align 2
.long 4 # Debug section magic
.cv_filechecksums # File index to string table offset subsection
.cv_stringtable # String table
# CHECK: CodeViewDebugInfo [
# CHECK: Section: .debug$S (4)
# CHECK: Magic: 0x4
# CHECK-NOT: FileChecksum
# CHECK: ]

Some files were not shown because too many files have changed in this diff Show More