<NME> ehframe-relocation.s
<BEF> // REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
// RUN: ld.lld %t.o -o %t
// RUN: llvm-readobj -s %t | FileCheck %s
// RUN: llvm-objdump -d %t | FileCheck --check-prefix=DISASM %s

// CHECK:      Name: .eh_frame
// CHECK-NEXT: Type: SHT_PROGBITS
// CHECK-NEXT: Flags [
// CHECK-NEXT:   SHF_ALLOC
// CHECK-NEXT: ]
// CHECK-NEXT: Address: 0x10120
// CHECK-NEXT: Offset:
// CHECK-NEXT: Size: 0

// 0x10120 = 65824
// 0x10120 + 5 = 65829
// DISASM:      Disassembly of section .text:
// DISASM-EMPTY:
// DISASM-NEXT: _start:
// DISASM-NEXT:   201154: {{.*}} movq 2097440, %rax
// DISASM-NEXT:   20115c: {{.*}} movq 2097445, %rax

.section .eh_frame,"ax",@unwind

.section .text
.globl _start
_start:
 movq .eh_frame, %rax
 movq .eh_frame + 5, %rax

<MSG> Make this test a bit stronger.

Show that in addition to handling empty .eh_frame, it is merged with any
regular .eh_frame.

git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@265588 91177308-0d34-0410-b5e6-96231b3b80d8

<DFF> @@ -1,6 +1,7 @@
 // REQUIRES: x86
 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
-// RUN: ld.lld %t.o -o %t
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/ehframe-relocation.s  -o %t2.o
+// RUN: ld.lld %t.o %t2.o -o %t
 // RUN: llvm-readobj -s %t | FileCheck %s
 // RUN: llvm-objdump -d %t | FileCheck --check-prefix=DISASM %s
 
@@ -11,7 +12,8 @@
 // CHECK-NEXT: ]
 // CHECK-NEXT: Address: 0x10120
 // CHECK-NEXT: Offset:
-// CHECK-NEXT: Size: 0
+// CHECK-NEXT: Size: 48
+// CHECK-NOT: .eh_frame
 
 // 0x10120 = 65824
 // 0x10120 + 5 = 65829

{'commit': 'diff --git a/test/ELF/Inputs/ehframe-relocation.s b/test/ELF/Inputs/ehframe-relocation.s\nnew file mode 100644\nindex 000000000..7ba6c0510\n--- /dev/null\n+++ b/test/ELF/Inputs/ehframe-relocation.s\n@@ -0,0 +1,2 @@\n+        .cfi_startproc\n+        .cfi_endproc\ndiff --git a/test/ELF/ehframe-relocation.s b/test/ELF/ehframe-relocation.s\nindex f952ebc60..38ac33f7e 100644\n--- a/test/ELF/ehframe-relocation.s\n+++ b/test/ELF/ehframe-relocation.s\n@@ -1,6 +1,7 @@\n // REQUIRES: x86\n // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o\n-// RUN: ld.lld %t.o -o %t\n+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/ehframe-relocation.s  -o %t2.o\n+// RUN: ld.lld %t.o %t2.o -o %t\n // RUN: llvm-readobj -s %t | FileCheck %s\n // RUN: llvm-objdump -d %t | FileCheck --check-prefix=DISASM %s\n \n@@ -11,7 +12,8 @@\n // CHECK-NEXT: ]\n // CHECK-NEXT: Address: 0x10120\n // CHECK-NEXT: Offset:\n-// CHECK-NEXT: Size: 0\n+// CHECK-NEXT: Size: 48\n+// CHECK-NOT: .eh_frame\n \n // 0x10120 = 65824\n // 0x10120 + 5 = 65829\n', 'commit_subject': 'Make this test a bit stronger.', 'repo_name': 'llvm-mirror/lld', 'committer': {'name': 'Rafael Espindola', 'email': '6b31706989f3cf9466bfddbf48eab0c43e646ba8@gmail.com', 'time_sec': '1459971506', 'tz_offset': '0', 'date': {'seconds': '1459971506'}}, 'commit_tree': '3d7ae331014e52638b65b08704203b61369212fa', 'commit_message': 'Make this test a bit stronger.\n\nShow that in addition to handling empty .eh_frame, it is merged with any\nregular .eh_frame.\n\ngit-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@265588 91177308-0d34-0410-b5e6-96231b3b80d8\n', 'language_name': 'Python', 'license': 'apache-2.0', 'hunks': '@@ -1,6 +1,7 @@\n // REQUIRES: x86\n // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o\n-// RUN: ld.lld %t.o -o %t\n+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/ehframe-relocation.s  -o %t2.o\n+// RUN: ld.lld %t.o %t2.o -o %t\n // RUN: llvm-readobj -s %t | FileCheck %s\n // RUN: llvm-objdump -d %t | FileCheck --check-prefix=DISASM %s\n \n@@ -11,7 +12,8 @@\n // CHECK-NEXT: ]\n // CHECK-NEXT: Address: 0x10120\n // CHECK-NEXT: Offset:\n-// CHECK-NEXT: Size: 0\n+// CHECK-NEXT: Size: 48\n+// CHECK-NOT: .eh_frame\n \n // 0x10120 = 65824\n // 0x10120 + 5 = 65829\n', 'addition_count': 4, 'deletion_count': 2, 'src_file': 'a/test/ELF/ehframe-relocation.s', 'tgt_file': 'b/test/ELF/ehframe-relocation.s', 'file_extension': '.s', 'before_file': '// REQUIRES: x86\n// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o\n// RUN: ld.lld %t.o -o %t\n// RUN: llvm-readobj -s %t | FileCheck %s\n// RUN: llvm-objdump -d %t | FileCheck --check-prefix=DISASM %s\n\n// CHECK:      Name: .eh_frame\n// CHECK-NEXT: Type: SHT_PROGBITS\n// CHECK-NEXT: Flags [\n// CHECK-NEXT:   SHF_ALLOC\n// CHECK-NEXT: ]\n// CHECK-NEXT: Address: 0x10120\n// CHECK-NEXT: Offset:\n// CHECK-NEXT: Size: 0\n\n// 0x10120 = 65824\n// 0x10120 + 5 = 65829\n// DISASM:      Disassembly of section .text:\n// DISASM-EMPTY:\n// DISASM-NEXT: _start:\n// DISASM-NEXT:   201154: {{.*}} movq 2097440, %rax\n// DISASM-NEXT:   20115c: {{.*}} movq 2097445, %rax\n\n.section .eh_frame,"ax",@unwind\n\n.section .text\n.globl _start\n_start:\n movq .eh_frame, %rax\n movq .eh_frame + 5, %rax\n', 'message': 'Make this test a bit stronger.\n\nShow that in addition to handling empty .eh_frame, it is merged with any\nregular .eh_frame.\n\ngit-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@265588 91177308-0d34-0410-b5e6-96231b3b80d8\n', 'author_name': 'Rafael Espindola', 'lang': 's'}