Rename input files for arm relocation test to be more consistent
authorEli Bendersky <eliben@gmail.com>
Wed, 5 Sep 2018 12:32:04 +0000 (05:32 -0700)
committerEli Bendersky <eliben@gmail.com>
Wed, 5 Sep 2018 12:32:04 +0000 (05:32 -0700)
test/testfiles_for_unittests/arm_reloc_relocated.elf [new file with mode: 0755]
test/testfiles_for_unittests/arm_reloc_source.c [new file with mode: 0644]
test/testfiles_for_unittests/arm_reloc_unrelocated.o [new file with mode: 0644]
test/testfiles_for_unittests/reloc_simple_arm_llvm.o [deleted file]
test/testfiles_for_unittests/simple.c [deleted file]
test/testfiles_for_unittests/simple_arm_llvm.elf [deleted file]
test_arm_call_reloc.py

diff --git a/test/testfiles_for_unittests/arm_reloc_relocated.elf b/test/testfiles_for_unittests/arm_reloc_relocated.elf
new file mode 100755 (executable)
index 0000000..f1cfbb8
Binary files /dev/null and b/test/testfiles_for_unittests/arm_reloc_relocated.elf differ
diff --git a/test/testfiles_for_unittests/arm_reloc_source.c b/test/testfiles_for_unittests/arm_reloc_source.c
new file mode 100644 (file)
index 0000000..4ea1c67
--- /dev/null
@@ -0,0 +1,41 @@
+/* Generated by compiling with any LLVM version and
+** with any GNU Arm Embedded Toolchain version.
+** LLVM 3.8.0/5.0.0 and GNU Arm Embedded Toolchain 2.26 is fine.
+**
+** clang -O0 --target=arm-none-eabi -emit-llvm -c simple.c -o simple.bc
+** llc -O0 -march=arm -filetype=obj simple.bc -o reloc_simple_arm_llvm.o
+** arm-none-eabi-ld -e main reloc_simple_arm_llvm.o -o simple_arm_llvm.elf
+**
+** reloc_simple_arm_llvm.o is ELF file that needs call relocation.
+**
+** simple_arm_llvm.elf is a relocated ELF file.
+*/
+
+int add(int a, int b) {
+    return a + b;
+}
+
+int sub(int a, int b) {
+    return a - b;
+}
+
+int mul(int a, int b) {
+    return a * b;
+}
+
+void triple(int a, int b) {
+    add(a, b);
+    sub(a, b);
+    mul(a, b);
+}
+
+int main(void) {
+    int a = 0xABCD, b = 0x1234;
+
+    add(a, b);
+    sub(a, b);
+    mul(a, b);
+    triple(a, b);
+
+    return 0;
+}
diff --git a/test/testfiles_for_unittests/arm_reloc_unrelocated.o b/test/testfiles_for_unittests/arm_reloc_unrelocated.o
new file mode 100644 (file)
index 0000000..a1bfbaa
Binary files /dev/null and b/test/testfiles_for_unittests/arm_reloc_unrelocated.o differ
diff --git a/test/testfiles_for_unittests/reloc_simple_arm_llvm.o b/test/testfiles_for_unittests/reloc_simple_arm_llvm.o
deleted file mode 100644 (file)
index a1bfbaa..0000000
Binary files a/test/testfiles_for_unittests/reloc_simple_arm_llvm.o and /dev/null differ
diff --git a/test/testfiles_for_unittests/simple.c b/test/testfiles_for_unittests/simple.c
deleted file mode 100644 (file)
index 4ea1c67..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Generated by compiling with any LLVM version and
-** with any GNU Arm Embedded Toolchain version.
-** LLVM 3.8.0/5.0.0 and GNU Arm Embedded Toolchain 2.26 is fine.
-**
-** clang -O0 --target=arm-none-eabi -emit-llvm -c simple.c -o simple.bc
-** llc -O0 -march=arm -filetype=obj simple.bc -o reloc_simple_arm_llvm.o
-** arm-none-eabi-ld -e main reloc_simple_arm_llvm.o -o simple_arm_llvm.elf
-**
-** reloc_simple_arm_llvm.o is ELF file that needs call relocation.
-**
-** simple_arm_llvm.elf is a relocated ELF file.
-*/
-
-int add(int a, int b) {
-    return a + b;
-}
-
-int sub(int a, int b) {
-    return a - b;
-}
-
-int mul(int a, int b) {
-    return a * b;
-}
-
-void triple(int a, int b) {
-    add(a, b);
-    sub(a, b);
-    mul(a, b);
-}
-
-int main(void) {
-    int a = 0xABCD, b = 0x1234;
-
-    add(a, b);
-    sub(a, b);
-    mul(a, b);
-    triple(a, b);
-
-    return 0;
-}
diff --git a/test/testfiles_for_unittests/simple_arm_llvm.elf b/test/testfiles_for_unittests/simple_arm_llvm.elf
deleted file mode 100755 (executable)
index f1cfbb8..0000000
Binary files a/test/testfiles_for_unittests/simple_arm_llvm.elf and /dev/null differ
index 685cd71f35ab0c537c6adf60b67b54e112a38e06..cb524198811f3ad1ae43bb45bfe31975d6c6ac5a 100755 (executable)
@@ -35,8 +35,8 @@ def do_relocation(rel_elf):
 class TestARMRElocation(unittest.TestCase):
     def test_reloc(self):
         test_dir = os.path.joinjoin('test', 'testfiles_for_unittests')
-        with open(join(test_dir, 'reloc_simple_arm_llvm.o'), 'rb') as rel_f, \
-                open(join(test_dir, 'simple_arm_llvm.elf'), 'rb') as f:
+        with open(join(test_dir, 'arm_reloc_unrelocated.o'), 'rb') as rel_f, \
+                open(join(test_dir, 'arm_reloc_relocated.elf'), 'rb') as f:
             rel_elf = ELFFile(rel_f)
             elf = ELFFile(f)