pass $testname
}
+# Test building a deterministic archive.
+
+proc deterministic_archive { } {
+ global AR
+ global AS
+ global NM
+ global srcdir
+ global subdir
+
+ set testname "ar deterministic archive"
+
+ if ![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o] {
+ unresolved $testname
+ return
+ }
+
+ if [is_remote host] {
+ set archive artest.a
+ set objfile [remote_download host tmpdir/bintest.o]
+ remote_file host delete $archive
+ } else {
+ set archive tmpdir/artest.a
+ set objfile tmpdir/bintest.o
+ }
+
+ remote_file build delete tmpdir/artest.a
+
+ set got [binutils_run $AR "rcD $archive ${objfile}"]
+ if ![string match "" $got] {
+ fail $testname
+ return
+ }
+
+ set got [binutils_run $AR "tv $archive"]
+ # This only checks the file mode and uid/gid. We can't easily match
+ # date because it's printed with the user's timezone.
+ if ![string match "rw-r--r-- 0/0 *bintest.o*" $got] {
+ fail $testname
+ return
+ }
+
+ pass $testname
+}
+
# Run the tests.
long_filenames
thin_archive
thin_archive_with_nested
argument_parsing
+deterministic_archive