* objcopy.c: Add --interleave-width option to allow interleaving
[deliverable/binutils-gdb.git] / binutils / testsuite / binutils-all / objcopy.exp
index 94a31aa357181e3f25625c7b0098565134a939ef..6bfd164b65e4751f382cbc243f310d100123df9b 100644 (file)
@@ -1,5 +1,5 @@
 #   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-#   2004, 2006, 2007, 2009
+#   2004, 2006, 2007, 2009, 2010
 #   Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -144,6 +144,43 @@ if ![string match "" $got] then {
     }
 }
 
+# Test interleaved copy of multiple byte width
+
+set sequence_file sequence_file
+set file [open ${sequence_file} w]
+puts ${file} "12345678"
+close ${file}
+
+if [is_remote host] {
+    remote_upload host ${sequence_file} tmpdir/sequence_file
+    set sequence_file tmpdir/sequence_file
+}
+
+set got [binutils_run $OBJCOPY "-I binary -i 4 -b 0 --interleave-width 2 ${sequence_file} ${copyfile}"]
+
+if ![string match "" $got] then {
+    fail "objcopy -i --interleave-width"
+} else {
+    if [is_remote host] {
+       remote_upload host ${copyfile} tmpdir/interleave_output
+       set interleave_output tmpdir/interleave_output
+    } else {
+       set interleave_output ${copyfile}
+    }
+
+    set file [open ${interleave_output} r]
+    gets $file line
+    send_log "$line\n"
+    verbose $line
+
+    if ![string match "1256" $line] then {
+       fail "objcopy -i --interleave-width"
+    }
+    pass "objcopy -i --interleave-width"
+
+    close $file
+}
+
 # Test generating S records.
 
 # We make the srec filename 8.3 compatible. Note that the header string
This page took 0.023665 seconds and 4 git commands to generate.