aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/MC/ELF
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/MC/ELF')
-rw-r--r--llvm/test/MC/ELF/AArch64/cfi.s4
-rw-r--r--llvm/test/MC/ELF/cfi.s4
-rw-r--r--llvm/test/MC/ELF/many-instructions.s10
-rw-r--r--llvm/test/MC/ELF/section-sym-err.s7
-rw-r--r--llvm/test/MC/ELF/section-sym-err2.s6
-rw-r--r--llvm/test/MC/ELF/section-sym2.s52
-rw-r--r--llvm/test/MC/ELF/undefined-debug.s5
7 files changed, 55 insertions, 33 deletions
diff --git a/llvm/test/MC/ELF/AArch64/cfi.s b/llvm/test/MC/ELF/AArch64/cfi.s
index 6bdf03c..7047f92 100644
--- a/llvm/test/MC/ELF/AArch64/cfi.s
+++ b/llvm/test/MC/ELF/AArch64/cfi.s
@@ -557,12 +557,14 @@ f37:
// CHECK-NEXT: }
.ifdef ERR
-// ERR: [[#@LINE+1]]:15: error: expected .eh_frame or .debug_frame
+// ERR: [[#@LINE+1]]:15: error: expected .eh_frame, .debug_frame, or .sframe
.cfi_sections $
// ERR: [[#@LINE+1]]:28: error: expected comma
.cfi_sections .debug_frame $
// ERR: [[#@LINE+1]]:39: error: expected comma
.cfi_sections .debug_frame, .eh_frame $
+// ERR: [[#@LINE+1]]:48: error: expected comma
+.cfi_sections .debug_frame, .eh_frame, .sframe $
// ERR: [[#@LINE+1]]:16: error: unexpected token
.cfi_startproc $
diff --git a/llvm/test/MC/ELF/cfi.s b/llvm/test/MC/ELF/cfi.s
index 3bd16ae..b7f9371 100644
--- a/llvm/test/MC/ELF/cfi.s
+++ b/llvm/test/MC/ELF/cfi.s
@@ -445,12 +445,14 @@ f37:
// CHECK: }
.ifdef ERR
-// ERR: [[#@LINE+1]]:15: error: expected .eh_frame or .debug_frame
+// ERR: [[#@LINE+1]]:15: error: expected .eh_frame, .debug_frame, or .sframe
.cfi_sections $
// ERR: [[#@LINE+1]]:28: error: expected comma
.cfi_sections .debug_frame $
// ERR: [[#@LINE+1]]:39: error: expected comma
.cfi_sections .debug_frame, .eh_frame $
+// ERR: [[#@LINE+1]]:48: error: expected comma
+.cfi_sections .debug_frame, .eh_frame, .sframe $
// ERR: [[#@LINE+1]]:16: error: unexpected token
.cfi_startproc $
diff --git a/llvm/test/MC/ELF/many-instructions.s b/llvm/test/MC/ELF/many-instructions.s
new file mode 100644
index 0000000..cbdb2a7
--- /dev/null
+++ b/llvm/test/MC/ELF/many-instructions.s
@@ -0,0 +1,10 @@
+# REQUIRES: asserts
+# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o /dev/null -debug-only=mc-dump
+
+## Test that encodeInstruction may cause a new fragment to be created.
+# CHECK: 0 Data Size:16200
+# CHECK: 16200 Data Size:180
+
+.rept 16384/10
+movabsq $foo, %rax
+.endr
diff --git a/llvm/test/MC/ELF/section-sym-err.s b/llvm/test/MC/ELF/section-sym-err.s
index afed21d..2f7ab69 100644
--- a/llvm/test/MC/ELF/section-sym-err.s
+++ b/llvm/test/MC/ELF/section-sym-err.s
@@ -1,6 +1,9 @@
-// RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t.o 2>&1 | FileCheck %s
+# RUN: not llvm-mc -filetype=obj -triple x86_64 %s -o %t 2>&1 | FileCheck %s
.section foo
foo:
+# CHECK: [[#@LINE-1]]:1: error: symbol 'foo' is already defined
-// CHECK: error: symbol 'foo' is already defined
+x1:
+.section x1
+# CHECK: <unknown>:0: error: invalid symbol redefinition
diff --git a/llvm/test/MC/ELF/section-sym-err2.s b/llvm/test/MC/ELF/section-sym-err2.s
deleted file mode 100644
index 27d8e9a..0000000
--- a/llvm/test/MC/ELF/section-sym-err2.s
+++ /dev/null
@@ -1,6 +0,0 @@
-// RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t.o 2>&1 | FileCheck %s
-
-foo:
-.section foo
-
-// CHECK: error: invalid symbol redefinition
diff --git a/llvm/test/MC/ELF/section-sym2.s b/llvm/test/MC/ELF/section-sym2.s
index b404ef7..fe2b904 100644
--- a/llvm/test/MC/ELF/section-sym2.s
+++ b/llvm/test/MC/ELF/section-sym2.s
@@ -1,24 +1,40 @@
-// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj --symbols -r --expand-relocs - | FileCheck %s
+# RUN: llvm-mc -filetype=obj -triple x86_64 %s -o %t
+# RUN: llvm-readelf -SrsX %t | FileCheck %s
-// Test that we can forward reference a section.
+## Test that we can forward reference a section.
mov .rodata, %rsi
-.section .rodata
+mov data, %rsi
+mov .debug_info, %rsi
+mov .debug_abbrev, %rsi
-// CHECK:Relocations [
-// CHECK: Section {{.*}} .rela.text {
-// CHECK: Relocation {
-// CHECK: Offset: 0x4
-// CHECK: Type: R_X86_64_32S (11)
-// CHECK: Symbol: .rodata
-// CHECK: Addend: 0x0
-// CHECK: }
-// CHECK: }
-// CHECK:]
+.section .rodata,"a"
+.pushsection data, 2; .long 2; .popsection
+.section data; .long 1
+.section .debug_info,"G",@progbits,11,comdat; .long x1
+.section .debug_info,"G",@progbits,22,comdat; .long x2
+.section .debug_info,"",@progbits; .long x0
-// There is only one .rodata symbol
+.text
+mov data, %rdi
-// CHECK:Symbols [
-// CHECK: Type: Section (0x3)
-// CHECK: Section: .rodata
-// CHECK-NOT: Section: .rodata
+# CHECK: Relocation section '.rela.text'
+# CHECK: R_X86_64_32S {{.*}} data + 0
+# CHECK: R_X86_64_32S {{.*}} data + 0
+
+# CHECK: Relocation section '.rela.debug_info' at offset {{.*}} contains 1
+# CHECK: Relocation section '.rela.debug_info' at offset {{.*}} contains 1
+# CHECK: Relocation section '.rela.debug_info' at offset {{.*}} contains 1
+
+# CHECK: Symbol table '.symtab' contains 10 entries:
+# CHECK-NEXT: Num:
+# CHECK-NEXT: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+# CHECK-NEXT: 0000000000000000 0 SECTION LOCAL DEFAULT [[#]] (.rodata) .rodata
+# CHECK-NEXT: 0000000000000000 0 SECTION LOCAL DEFAULT [[#]] (data) data
+# CHECK-NEXT: 0000000000000000 0 SECTION LOCAL DEFAULT [[#]] (.debug_info) .debug_info
+# CHECK-NEXT: 0000000000000000 0 NOTYPE LOCAL DEFAULT [[#]] (.group) 11
+# CHECK-NEXT: 0000000000000000 0 NOTYPE LOCAL DEFAULT [[#]] (.group) 22
+# CHECK-NEXT: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND .debug_abbrev
+# CHECK-NEXT: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND x1
+# CHECK-NEXT: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND x2
+# CHECK-NEXT: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND x0
diff --git a/llvm/test/MC/ELF/undefined-debug.s b/llvm/test/MC/ELF/undefined-debug.s
deleted file mode 100644
index 95ead70..0000000
--- a/llvm/test/MC/ELF/undefined-debug.s
+++ /dev/null
@@ -1,5 +0,0 @@
-// RUN: not llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o %t 2>&1 | FileCheck %s
-// CHECK: error: Undefined section reference: .debug_pubnames
-
-.section .foo,"",@progbits
- .long .debug_pubnames