[LLD][ELF] - Convert common-symbol-alignment.s test to yaml.
authorGeorge Rimar <grimar@accesssoftek.com>
Wed, 6 Mar 2019 13:49:41 +0000 (13:49 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Wed, 6 Mar 2019 13:49:41 +0000 (13:49 +0000)
This removes 2 precompiled binaries from the inputs.

llvm-svn: 355500

lld/test/ELF/invalid/Inputs/common-symbol-alignment.elf [deleted file]
lld/test/ELF/invalid/Inputs/common-symbol-alignment2.elf [deleted file]
lld/test/ELF/invalid/common-symbol-alignment.s [deleted file]
lld/test/ELF/invalid/common-symbol-alignment.test [new file with mode: 0644]

diff --git a/lld/test/ELF/invalid/Inputs/common-symbol-alignment.elf b/lld/test/ELF/invalid/Inputs/common-symbol-alignment.elf
deleted file mode 100644 (file)
index 9e7823b..0000000
Binary files a/lld/test/ELF/invalid/Inputs/common-symbol-alignment.elf and /dev/null differ
diff --git a/lld/test/ELF/invalid/Inputs/common-symbol-alignment2.elf b/lld/test/ELF/invalid/Inputs/common-symbol-alignment2.elf
deleted file mode 100644 (file)
index 21c2457..0000000
Binary files a/lld/test/ELF/invalid/Inputs/common-symbol-alignment2.elf and /dev/null differ
diff --git a/lld/test/ELF/invalid/common-symbol-alignment.s b/lld/test/ELF/invalid/common-symbol-alignment.s
deleted file mode 100644 (file)
index 2a654b1..0000000
+++ /dev/null
@@ -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
diff --git a/lld/test/ELF/invalid/common-symbol-alignment.test b/lld/test/ELF/invalid/common-symbol-alignment.test
new file mode 100644 (file)
index 0000000..1a7ebda
--- /dev/null
@@ -0,0 +1,36 @@
+## 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
+
+--- !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