[lld] r355500 - [LLD][ELF] - Convert common-symbol-alignment.s test to yaml.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 6 05:49:41 PST 2019
Author: grimar
Date: Wed Mar 6 05:49:41 2019
New Revision: 355500
URL: http://llvm.org/viewvc/llvm-project?rev=355500&view=rev
Log:
[LLD][ELF] - Convert common-symbol-alignment.s test to yaml.
This removes 2 precompiled binaries from the inputs.
Added:
lld/trunk/test/ELF/invalid/common-symbol-alignment.test
- copied, changed from r355499, lld/trunk/test/ELF/invalid/common-symbol-alignment.s
Removed:
lld/trunk/test/ELF/invalid/Inputs/common-symbol-alignment.elf
lld/trunk/test/ELF/invalid/Inputs/common-symbol-alignment2.elf
lld/trunk/test/ELF/invalid/common-symbol-alignment.s
Removed: lld/trunk/test/ELF/invalid/Inputs/common-symbol-alignment.elf
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/invalid/Inputs/common-symbol-alignment.elf?rev=355499&view=auto
==============================================================================
Binary file - no diff available.
Removed: lld/trunk/test/ELF/invalid/Inputs/common-symbol-alignment2.elf
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/invalid/Inputs/common-symbol-alignment2.elf?rev=355499&view=auto
==============================================================================
Binary file - no diff available.
Removed: lld/trunk/test/ELF/invalid/common-symbol-alignment.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/invalid/common-symbol-alignment.s?rev=355499&view=auto
==============================================================================
--- lld/trunk/test/ELF/invalid/common-symbol-alignment.s (original)
+++ lld/trunk/test/ELF/invalid/common-symbol-alignment.s (removed)
@@ -1,12 +0,0 @@
-# REQUIRES: x86
-
-## common-symbol-alignment.elf contains common symbol with zero alignment.
-# RUN: not ld.lld %S/Inputs/common-symbol-alignment.elf \
-# RUN: -o %t 2>&1 | FileCheck %s
-# CHECK: common symbol 'bar' has invalid alignment: 0
-
-## common-symbol-alignment2.elf contains common symbol alignment greater
-## than UINT32_MAX.
-# RUN: not ld.lld %S/Inputs/common-symbol-alignment2.elf \
-# RUN: -o %t 2>&1 | FileCheck %s --check-prefix=BIG
-# BIG: common symbol 'bar' has invalid alignment: 271644049215
Copied: lld/trunk/test/ELF/invalid/common-symbol-alignment.test (from r355499, lld/trunk/test/ELF/invalid/common-symbol-alignment.s)
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/invalid/common-symbol-alignment.test?p2=lld/trunk/test/ELF/invalid/common-symbol-alignment.test&p1=lld/trunk/test/ELF/invalid/common-symbol-alignment.s&r1=355499&r2=355500&rev=355500&view=diff
==============================================================================
--- lld/trunk/test/ELF/invalid/common-symbol-alignment.s (original)
+++ lld/trunk/test/ELF/invalid/common-symbol-alignment.test Wed Mar 6 05:49:41 2019
@@ -1,12 +1,36 @@
-# REQUIRES: x86
-
-## common-symbol-alignment.elf contains common symbol with zero alignment.
-# RUN: not ld.lld %S/Inputs/common-symbol-alignment.elf \
-# RUN: -o %t 2>&1 | FileCheck %s
+## If an object contains a common symbol with zero alignment,
+## check we report it.
+# RUN: yaml2obj -docnum=1 %s -o %t1.o
+# RUN: not ld.lld %t1.o -o %t 2>&1 | FileCheck %s
# CHECK: common symbol 'bar' has invalid alignment: 0
-## common-symbol-alignment2.elf contains common symbol alignment greater
-## than UINT32_MAX.
-# RUN: not ld.lld %S/Inputs/common-symbol-alignment2.elf \
-# RUN: -o %t 2>&1 | FileCheck %s --check-prefix=BIG
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+Symbols:
+ Global:
+ - Name: bar
+ Type: STT_FUNC
+ Index: SHN_COMMON
+
+## If an object contains a common symbol with alignment greater
+## than UINT32_MAX, check we report it.
+# RUN: yaml2obj -docnum=2 %s -o %t2.o
+# RUN: not ld.lld %t2.o -o %t 2>&1 | FileCheck %s --check-prefix=BIG
# BIG: common symbol 'bar' has invalid alignment: 271644049215
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+Symbols:
+ Global:
+ - Name: bar
+ Type: STT_FUNC
+ Index: SHN_COMMON
+ Value: 0x0000003F3F3F3F3F
More information about the llvm-commits
mailing list