Imported Upstream version 5.18.0.167

Former-commit-id: 289509151e0fee68a1b591a20c9f109c3c789d3a
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-20 08:25:10 +00:00
parent e19d552987
commit b084638f15
28489 changed files with 184 additions and 3866856 deletions

View File

@@ -1,8 +0,0 @@
# RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - 2>&1 | FileCheck %s
# Missing .bundle_align_mode argument
# CHECK: error: unknown token
.bundle_align_mode
imull $17, %ebx, %ebp

View File

@@ -1,22 +0,0 @@
# RUN: llvm-mc -filetype=asm -triple x86_64-pc-linux-gnu %s -o - 2>&1 | FileCheck %s
# Just a simple test for the assembly emitter - making sure it emits back the
# bundling directives.
.text
foo:
.bundle_align_mode 4
# CHECK: .bundle_align_mode 4
pushq %rbp
.bundle_lock
# CHECK: .bundle_lock
cmpl %r14d, %ebp
jle .L_ELSE
.bundle_unlock
# CHECK: .bundle_unlock
.bundle_lock align_to_end
# CHECK: .bundle_lock align_to_end
add %rbx, %rdx
.bundle_unlock

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +0,0 @@
# RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - 2>&1 | FileCheck %s
# RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mc-relax-all %s -o - 2>&1 | FileCheck %s
# CHECK: ERROR: Fragment can't be larger than a bundle size
.text
foo:
.bundle_align_mode 4
pushq %rbp
.bundle_lock
pushq %r14
callq bar
callq bar
callq bar
callq bar
.bundle_unlock

View File

@@ -1,11 +0,0 @@
# RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - 2>&1 | FileCheck %s
# Missing .bundle_align_mode argument
# CHECK: error: invalid option
.bundle_align_mode 4
.bundle_lock 5
imull $17, %ebx, %ebp
.bundle_unlock

View File

@@ -1,27 +0,0 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
# Test two different executable sections with bundling.
.bundle_align_mode 3
.section text1, "x"
# CHECK: section text1
imull $17, %ebx, %ebp
imull $17, %ebx, %ebp
imull $17, %ebx, %ebp
# CHECK: 6: nop
# CHECK-NEXT: 8: imull
.section text2, "x"
# CHECK: section text2
imull $17, %ebx, %ebp
imull $17, %ebx, %ebp
imull $17, %ebx, %ebp
# CHECK: 6: nop
# CHECK-NEXT: 8: imull

View File

@@ -1,85 +0,0 @@
# RUN: llvm-mc -triple=i686-linux -filetype=obj %s -o - | \
# RUN: llvm-objdump -disassemble -no-show-raw-insn -r - | FileCheck %s
# RUN: llvm-mc -triple=i686-nacl -filetype=obj %s -o - | \
# RUN: llvm-objdump -disassemble -no-show-raw-insn -r - | FileCheck %s
# RUN: llvm-mc -triple=i686-nacl -filetype=obj -mc-relax-all %s -o - | \
# RUN: llvm-objdump -disassemble -no-show-raw-insn -r - | FileCheck %s
.bundle_align_mode 5
.text
.globl main
.align 32, 0x90
.type main,@function
main: # @main
# CHECK-LABEL: main:
# Call + pop sequence for determining the PIC base.
.bundle_lock align_to_end
calll .L0$pb
.bundle_unlock
.L0$pb:
popl %eax
# CHECK: 20: popl
# 26 bytes of instructions between the pop and the use of the pic base symbol.
movl $3, 2(%ebx, %ebx)
movl $3, 2(%ebx, %ebx)
movl $3, 2(%ebx, %ebx)
hlt
hlt
# CHECK: nop
.Ltmp0:
addl (.Ltmp0-.L0$pb), %eax
# The addl has bundle padding to push it from 0x3b to 0x40.
# The difference between the labels should be 0x20 (0x40-0x20) not 0x1b
# (0x3b-0x20)
# CHECK: 40: addl 32, %eax
popl %ecx
jmp *%ecx
# Also make sure it works with a non-relaxable instruction (cmp vs add)
# and for 2 adjacent labels that both point to the correct instruction
.section .text.bar, "ax"
.globl bar
.align 32, 0x90
.type bar,@function
bar:
# CHECK-LABEL: bar:
.bundle_lock align_to_end
calll .L1$pb
.bundle_unlock
.L1$pb:
popl %eax
# CHECK: 20: popl
# 26 bytes of instructions between the pop and the use of the pic base symbol.
movl $3, 2(%ebx, %ebx)
movl $3, 2(%ebx, %ebx)
movl $3, 2(%ebx, %ebx)
hlt
hlt
# CHECK: nop
.Ltmp1:
.Ltmp2:
cmpl %eax, .Ltmp1
# CHECK: 40: cmpl %eax, 64
cmpl %eax, (.Ltmp2-.L1$pb)
# CHECK: 46: cmpl %eax, 32
popl %ecx
jmp *%ecx
# Switch sections in the middle of a function
.section .text.foo, "ax"
.globl foo
.align 32, 0x90
.type foo,@function
# CHECK-LABEL: foo:
foo:
inc %eax
tmp3:
.rodata
.type obj,@object
.comm obj,4,4
.section .text.foo
inc %eax
# CHECK: tmp3:
# CHECK-NEXT: 1: incl

View File

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

View File

@@ -1,10 +0,0 @@
# RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - 2>&1 | FileCheck %s
# .bundle_lock can't come without a .bundle_align_mode before it
# CHECK: ERROR: .bundle_lock forbidden when bundling is disabled
imull $17, %ebx, %ebp
.bundle_lock

View File

@@ -1,29 +0,0 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
# Test that long nops are generated for padding where possible.
.text
foo:
.bundle_align_mode 5
# This callq instruction is 5 bytes long
.bundle_lock align_to_end
callq bar
.bundle_unlock
# To align this group to a bundle end, we need a 15-byte NOP and a 12-byte NOP.
# CHECK: 0: nop
# CHECK-NEXT: f: nop
# CHECK: 1b: callq
# This push instruction is 1 byte long
.bundle_lock align_to_end
push %rax
.bundle_unlock
# To align this group to a bundle end, we need two 15-byte NOPs, and a 1-byte.
# CHECK: 20: nop
# CHECK-NEXT: 2f: nop
# CHECK-NEXT: 3e: nop
# CHECK-NEXT: 3f: pushq

View File

@@ -1,23 +0,0 @@
# RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu -mcpu=pentiumpro %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - \
# RUN: | FileCheck -check-prefix=CHECK -check-prefix=CHECK-OPT %s
# RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - \
# RUN: | FileCheck -check-prefix=CHECK -check-prefix=CHECK-RELAX %s
.text
foo:
.bundle_align_mode 5
push %ebp # 1 byte
.align 16
.bundle_lock align_to_end
# CHECK: 1: nopw %cs:(%eax,%eax)
# CHECK: 10: nopw %cs:(%eax,%eax)
# CHECK-RELAX: 1f: nop
# CHECK-RELAX: 20: nopw %cs:(%eax,%eax)
# CHECK-RELAX: 2f: nopw %cs:(%eax,%eax)
# CHECK-OPT: 1b: calll -4
# CHECK-RELAX: 3b: calll -4
calll bar # 5 bytes
.bundle_unlock
ret # 1 byte

View File

@@ -1,31 +0,0 @@
# RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu -mcpu=pentiumpro %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - \
# RUN: | FileCheck -check-prefix=CHECK -check-prefix=CHECK-OPT %s
# RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - \
# RUN: | FileCheck -check-prefix=CHECK -check-prefix=CHECK-RELAX %s
.text
foo:
.bundle_align_mode 5
push %ebp # 1 byte
.align 16
# CHECK: 1: nopw %cs:(%eax,%eax)
# CHECK-RELAX: 10: nopw %cs:(%eax,%eax)
# CHECK-RELAX: 1f: nop
# CHECK-OPT: 10: movl $1, (%esp)
# CHECK-RELAX: 20: movl $1, (%esp)
movl $0x1, (%esp) # 7 bytes
movl $0x1, (%esp) # 7 bytes
# CHECK-OPT: 1e: nop
movl $0x2, 0x1(%esp) # 8 bytes
movl $0x2, 0x1(%esp) # 8 bytes
# CHECK-RELAX: 3e: nop
# CHECK-RELAX: 40: movl $2, 1(%esp)
movl $0x2, 0x1(%esp) # 8 bytes
movl $0x2, (%esp) # 7 bytes
# CHECK-OPT: 3f: nop
# CHECK-OPT: 40: movl $3, (%esp)
movl $0x3, (%esp) # 7 bytes
movl $0x3, (%esp) # 7 bytes
ret

View File

@@ -1,73 +0,0 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mc-relax-all %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
# Will be bundle-aligning to 16 byte boundaries
.bundle_align_mode 4
.text
# CHECK-LABEL: foo:
.type foo,@function
foo:
# Test that bundle alignment mode can be set more than once.
.bundle_align_mode 4
# Each of these callq instructions is 5 bytes long
callq bar
callq bar
.bundle_lock
.bundle_lock
callq bar
callq bar
.bundle_unlock
.bundle_unlock
# CHECK: 10: callq {{.*}} <bar>
# CHECK-NEXT: 15: callq {{.*}} <bar>
.p2align 4
# CHECK-LABEL: bar:
.type bar,@function
bar:
callq foo
callq foo
# Check that the callqs get bundled together, and that the whole group is
# align_to_end
.bundle_lock
callq bar
.bundle_lock align_to_end
callq bar
.bundle_unlock
.bundle_unlock
# CHECK: 36: callq {{.*}} <bar>
# CHECK-NEXT: 3b: callq {{.*}} <bar>
# CHECK-LABEL: baz:
.type baz,@function
baz:
callq foo
callq foo
# Check that the callqs get bundled together, and that the whole group is
# align_to_end (with the outer directive marked align_to_end)
.bundle_lock align_to_end
callq bar
.bundle_lock
callq bar
.bundle_unlock
.bundle_unlock
# CHECK: 56: callq {{.*}} <bar>
# CHECK-NEXT: 5b: callq {{.*}} <bar>
# CHECK-LABEL: quux
.type quux,@function
quux:
callq bar
callq bar
.bundle_lock
.bundle_lock
callq bar
.bundle_unlock
callq bar
.bundle_unlock
# Check that the calls are bundled together when the second one is after the
# inner nest is closed.
# CHECK: 70: callq {{.*}} <bar>
# CHECK-NEXT: 75: callq {{.*}} <bar>

View File

@@ -1,35 +0,0 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
# Test some variations of padding to the end of a bundle.
.text
foo:
.bundle_align_mode 4
# Each of these callq instructions is 5 bytes long
callq bar
callq bar
.bundle_lock align_to_end
callq bar
.bundle_unlock
# To align this group to a bundle end, we need a 1-byte NOP.
# CHECK: a: nop
# CHECK-NEXT: b: callq
callq bar
callq bar
.bundle_lock align_to_end
callq bar
callq bar
.bundle_unlock
# Here we have to pad until the end of the *next* boundary because
# otherwise the group crosses a boundary.
# CHECK: 1a: nop
# The nop sequence may be implemented as one instruction or many, but if
# it's one instruction, that instruction cannot itself cross the boundary.
# CHECK: 20: nop
# CHECK-NEXT: 26: callq
# CHECK-NEXT: 2b: callq

View File

@@ -1,48 +0,0 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
# Test some variations of padding for bundle-locked groups.
.text
foo:
.bundle_align_mode 4
# Each of these callq instructions is 5 bytes long
callq bar
callq bar
.bundle_lock
callq bar
callq bar
.bundle_unlock
# We'll need a 6-byte NOP before this group
# CHECK: a: nop
# CHECK-NEXT: 10: callq
# CHECK-NEXT: 15: callq
.bundle_lock
callq bar
callq bar
.bundle_unlock
# Same here
# CHECK: 1a: nop
# CHECK-NEXT: 20: callq
# CHECK-NEXT: 25: callq
.align 16, 0x90
callq bar
.bundle_lock
callq bar
callq bar
callq bar
.bundle_unlock
# And here we'll need a 11-byte NOP
# CHECK: 30: callq
# CHECK: 35: nop
# CHECK-NEXT: 40: callq
# CHECK-NEXT: 45: callq

View File

@@ -1,18 +0,0 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mc-relax-all %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
# Test that an instruction near a bundle end gets properly padded
# after it is relaxed.
.text
foo:
.bundle_align_mode 5
.rept 29
push %rax
.endr
# CHECK: 1c: push
# CHECK: 1d: nop
# CHECK: 20: jne
jne 0x100

View File

@@ -1,44 +0,0 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro %s -o - \
# RUN: | llvm-objdump -disassemble - | FileCheck %s
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu -mcpu=pentiumpro -mc-relax-all %s -o - \
# RUN: | llvm-objdump -disassemble - | FileCheck %s
# Test that instructions inside bundle-locked groups are relaxed even if their
# fixup is short enough not to warrant relaxation on its own.
.text
foo:
.bundle_align_mode 4
pushq %rbp
movl %edi, %ebx
callq bar
movl %eax, %r14d
imull $17, %ebx, %ebp
movl %ebx, %edi
callq bar
cmpl %r14d, %ebp
.bundle_lock
jle .L_ELSE
# This group would've started at 0x18 and is too long, so a chunky NOP padding
# is inserted to push it to 0x20.
# CHECK: 18: {{[a-f0-9 ]+}} nopl
# The long encoding for JLE should be used here even though its target is close
# CHECK-NEXT: 20: 0f 8e
addl %ebp, %eax
jmp .L_RET
# Same for the JMP
# CHECK: 28: e9
.bundle_unlock
.L_ELSE:
imull %ebx, %eax
.L_RET:
popq %rbx

View File

@@ -1,30 +0,0 @@
# RUN: llvm-mc -triple=i686-nacl -filetype=obj %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
# RUN: llvm-mc -triple=i686-nacl -filetype=obj -mc-relax-all %s -o - \
# RUN: | llvm-objdump -disassemble -no-show-raw-insn - | FileCheck %s
.bundle_align_mode 5
.text
.align 32, 0x90
# CHECK: 0: movl $14, 8(%esp)
movl $.str2, 8(%esp)
# CHECK: 8: movl $7, 4(%esp)
movl $.str1, 4(%esp)
# CHECK: 10: movl $0, (%esp)
movl $.str, (%esp)
.type .str,@object
.section .rodata,"a",@progbits
.str:
.asciz "hello1"
.size .str, 7
.type .str1,@object
.str1:
.asciz "hello2"
.size .str1, 7
.type .str2,@object
.str2:
.asciz "hello3"
.size .str2, 7

View File

@@ -1,23 +0,0 @@
# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - \
# RUN: | llvm-readobj -sections | FileCheck %s
# Test that bundle-aligned sections with instructions are aligned
.bundle_align_mode 5
# CHECK: Sections
# Check that the empty .text section has the default alignment
# CHECK-LABEL: Name: .text
# CHECK-NOT: Name
# CHECK: AddressAlignment: 4
.section text1, "x"
imull $17, %ebx, %ebp
# CHECK-LABEL: Name: text1
# CHECK-NOT: Name
# CHECK: AddressAlignment: 32
.section text2, "x"
imull $17, %ebx, %ebp
# CHECK-LABEL: Name: text2
# CHECK-NOT: Name
# CHECK: AddressAlignment: 32

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