aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ChangeLog12
-rw-r--r--ld/testsuite/ld-i386/abs-iamcu.d11
-rw-r--r--ld/testsuite/ld-i386/dummy.s1
-rw-r--r--ld/testsuite/ld-i386/foo.s3
-rw-r--r--ld/testsuite/ld-i386/i386.exp37
-rw-r--r--ld/testsuite/ld-i386/iamcu-1.d16
-rw-r--r--ld/testsuite/ld-i386/iamcu-2.d4
-rw-r--r--ld/testsuite/ld-i386/iamcu-3.d4
-rw-r--r--ld/testsuite/ld-i386/start.s3
9 files changed, 91 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 268e419..52f09fb 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,15 @@
+2015-05-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ * ld-i386/abs-iamcu.d: New file.
+ * ld-i386/dummy.s: Likewise.
+ * ld-i386/foo.s: Likewise.
+ * ld-i386/iamcu-1.d: Likewise.
+ * ld-i386/iamcu-2.d: Likewise.
+ * ld-i386/iamcu-3.d: Likewise.
+ * ld-i386/start.s: Likewise.
+ * ld-i386/i386.exp (iamcu_tests): New.
+ Run iamcu_tests.
+
2015-04-29 H.J. Lu <hongjiu.lu@intel.com>
PR ld/18354
diff --git a/ld/testsuite/ld-i386/abs-iamcu.d b/ld/testsuite/ld-i386/abs-iamcu.d
new file mode 100644
index 0000000..ac9beff
--- /dev/null
+++ b/ld/testsuite/ld-i386/abs-iamcu.d
@@ -0,0 +1,11 @@
+#name: Absolute non-overflowing relocs
+#source: abs.s
+#source: zero.s
+#as: --32 -march=iamcu
+#ld: -m elf_iamcu
+#objdump: -rs -j .text
+
+.*: file format .*
+
+Contents of section \.text:
+[ ][0-9a-f]+ c800fff0 c8000110 c9c3.*
diff --git a/ld/testsuite/ld-i386/dummy.s b/ld/testsuite/ld-i386/dummy.s
new file mode 100644
index 0000000..403f980
--- /dev/null
+++ b/ld/testsuite/ld-i386/dummy.s
@@ -0,0 +1 @@
+# Dummy
diff --git a/ld/testsuite/ld-i386/foo.s b/ld/testsuite/ld-i386/foo.s
new file mode 100644
index 0000000..461bfa4
--- /dev/null
+++ b/ld/testsuite/ld-i386/foo.s
@@ -0,0 +1,3 @@
+ .globl foo
+foo:
+ mov %eax, %ebx
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index 8399cbc..7309910 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -215,6 +215,43 @@ if [istarget "*-*-nacl*"] {
regsub -all -- {([a-z0-9]+)\.pd} $i386tests {\1-nacl.pd} i386tests
}
+proc iamcu_tests {} {
+ if {[istarget "*-*-nacl*"]} then {
+ return
+ }
+
+ global as
+ global srcdir
+ global subdir
+
+ if ![ld_assemble $as "--32 -march=iamcu $srcdir/$subdir/start.s" tmpdir/startiamcu.o] {
+ unresolved "Build Intel MCU start.o"
+ return
+ }
+
+ if ![ld_assemble $as "--32 $srcdir/$subdir/start.s" tmpdir/start32.o] {
+ unresolved "Build ia32 start.o"
+ return
+ }
+
+ if ![ld_assemble $as "--32 -march=iamcu $srcdir/$subdir/foo.s" tmpdir/fooiamcu.o] {
+ unresolved "Build Intel MCU foo.o"
+ return
+ }
+
+ if ![ld_assemble $as "--32 $srcdir/$subdir/foo.s" tmpdir/foo32.o] {
+ unresolved "Build ia32 foo.o"
+ return
+ }
+
+ run_dump_test "abs-iamcu"
+ run_dump_test "iamcu-1"
+ run_dump_test "iamcu-2"
+ run_dump_test "iamcu-3"
+}
+
+iamcu_tests
+
run_ld_link_tests $i386tests
run_dump_test "abs"
diff --git a/ld/testsuite/ld-i386/iamcu-1.d b/ld/testsuite/ld-i386/iamcu-1.d
new file mode 100644
index 0000000..c0f59fa
--- /dev/null
+++ b/ld/testsuite/ld-i386/iamcu-1.d
@@ -0,0 +1,16 @@
+#source: dummy.s
+#as: --32 -march=iamcu
+#ld: -m elf_iamcu tmpdir/startiamcu.o tmpdir/fooiamcu.o
+#readelf: -h
+
+ELF Header:
+ Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
+ Class: ELF32
+ Data: 2's complement, little endian
+ Version: 1 \(current\)
+ OS/ABI: UNIX - System V
+ ABI Version: 0
+ Type: EXEC \(Executable file\)
+ Machine: Intel MCU
+ Version: 0x1
+#pass
diff --git a/ld/testsuite/ld-i386/iamcu-2.d b/ld/testsuite/ld-i386/iamcu-2.d
new file mode 100644
index 0000000..7f6415b
--- /dev/null
+++ b/ld/testsuite/ld-i386/iamcu-2.d
@@ -0,0 +1,4 @@
+#source: dummy.s
+#as: --32 -march=iamcu
+#ld: -m elf_iamcu tmpdir/startiamcu.o tmpdir/foo32.o
+#error: .*i386(:.+)? architecture of input file `tmpdir/foo32.o' is incompatible with iamcu.* output
diff --git a/ld/testsuite/ld-i386/iamcu-3.d b/ld/testsuite/ld-i386/iamcu-3.d
new file mode 100644
index 0000000..0b71086
--- /dev/null
+++ b/ld/testsuite/ld-i386/iamcu-3.d
@@ -0,0 +1,4 @@
+#source: dummy.s
+#as: --32
+#ld: -m elf_i386 tmpdir/startiamcu.o tmpdir/foo32.o
+#error: iamcu.* architecture of input file `tmpdir/startiamcu.o' is incompatible with .*i386(:.+)? output
diff --git a/ld/testsuite/ld-i386/start.s b/ld/testsuite/ld-i386/start.s
new file mode 100644
index 0000000..80301c6
--- /dev/null
+++ b/ld/testsuite/ld-i386/start.s
@@ -0,0 +1,3 @@
+ .globl _start
+_start:
+ jmp foo