Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/ld Test SORT() command.



details:   https://anonhg.NetBSD.org/src/rev/d7ab60f285b5
branches:  trunk
changeset: 333759:d7ab60f285b5
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Sun Nov 16 03:49:09 2014 +0000

description:
Test SORT() command.

diffstat:

 tests/usr.bin/ld/t_script.sh |  32 +++++++++++++++++++++++++++-----
 1 files changed, 27 insertions(+), 5 deletions(-)

diffs (63 lines):

diff -r 8d0fd5cd3f5a -r d7ab60f285b5 tests/usr.bin/ld/t_script.sh
--- a/tests/usr.bin/ld/t_script.sh      Sun Nov 16 00:04:06 2014 +0000
+++ b/tests/usr.bin/ld/t_script.sh      Sun Nov 16 03:49:09 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: t_script.sh,v 1.5 2014/11/15 04:47:11 uebayasi Exp $
+#      $NetBSD: t_script.sh,v 1.6 2014/11/16 03:49:09 uebayasi Exp $
 #
 # Copyright (c) 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -63,13 +63,13 @@
 
 ################################################################################
 
-atf_test_case reorder
-reorder_head() {
+atf_test_case order_reorder
+order_reorder_head() {
        atf_set "descr" "check if object reordering works"
        atf_set "require.progs" "cc" "ld" "readelf" "nm" "sed" "grep"
 }
 
-reorder_body() {
+order_reorder_body() {
        cat > test.x << EOF
 SECTIONS {
        .data : {
@@ -85,6 +85,27 @@
 
 ################################################################################
 
+atf_test_case order_sort
+order_sort_head() {
+       atf_set "descr" "check if object sort works"
+       atf_set "require.progs" "cc" "ld" "readelf" "nm" "sed" "grep"
+}
+
+order_sort_body() {
+       cat > test.x << EOF
+SECTIONS {
+       .data : {
+               *(.data)
+               /* SORT_BY_NAME */
+               SORT(*)(.data.*)
+       }
+}
+EOF
+       order_assert_ascending
+}
+
+################################################################################
+
 atf_test_case multisec
 multisec_head() {
        atf_set "descr" "check if multiple SECTIONS commands work"
@@ -200,6 +221,7 @@
 {
        atf_add_test_case order_default
        atf_add_test_case order_merge
-       atf_add_test_case reorder
+       atf_add_test_case order_reorder
+       atf_add_test_case order_sort
        atf_add_test_case multisec
 }



Home | Main Index | Thread Index | Old Index