From: Alan Modra Date: Sun, 23 Jan 2011 03:29:30 +0000 (+0000) Subject: * ld-scripts/sane1.d, * ld-scripts/sane1.t: New test. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a2bb0805551035ee235d02e65da3d74304b9167;p=binutils-gdb.git * ld-scripts/sane1.d, * ld-scripts/sane1.t: New test. * ld-scripts/expr.exp: Run it. --- diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index cfa3d33c40d..0054966e366 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-01-23 Alan Modra + + * ld-scripts/sane1.d, * ld-scripts/sane1.t: New test. + * ld-scripts/expr.exp: Run it. + 2011-01-18 H.J. Lu * ld-x86-64/ilp32-4.d: Updated. diff --git a/ld/testsuite/ld-scripts/expr.exp b/ld/testsuite/ld-scripts/expr.exp index 467abcb9ac7..185fa4eccd0 100644 --- a/ld/testsuite/ld-scripts/expr.exp +++ b/ld/testsuite/ld-scripts/expr.exp @@ -22,3 +22,4 @@ run_dump_test expr1 run_dump_test expr2 +run_dump_test sane1 diff --git a/ld/testsuite/ld-scripts/sane1.d b/ld/testsuite/ld-scripts/sane1.d new file mode 100644 index 00000000000..26abaf3af8b --- /dev/null +++ b/ld/testsuite/ld-scripts/sane1.d @@ -0,0 +1,33 @@ +# source: data.s +# ld: -T sane1.t +# nm: -B +# notarget: mmix-* pdp11-* rs6000-*-aix* tic30-*-aout +# mmix symbol sections are wrong, pdp sign extends 16-bit addresses +# rs6000-aix and tic30 don't like empty .text + +#... +0+8004 D d1 +0+8024 D d2 +0+0020 A diff +0+0100 A e1 +0+0080 A e2 +0+8000 A e3 +0+0090 A prod +0+8002 D s1 +0+8001 D s2 +0+8007 D s3 +0+8002 A s4 +0+0004 A s5 +0+19a0 A s6 +0+8020 D s_diff +0+8090 D s_prod +0+8028 D s_sum +0+8020 D s_sum_neg +0+0028 A sum +0+0020 A sum_neg +0+8002 D x1 +0+8001 D x2 +0+8007 D x3 +0+8002 A x4 +0+0004 A x5 +0+19a0 A x6 diff --git a/ld/testsuite/ld-scripts/sane1.t b/ld/testsuite/ld-scripts/sane1.t new file mode 100644 index 00000000000..037a62c856b --- /dev/null +++ b/ld/testsuite/ld-scripts/sane1.t @@ -0,0 +1,36 @@ +LD_FEATURE("SANE_EXPR") +e1 = 0x100; +e2 = 0x80; +e3 = e1 * e2; +SECTIONS +{ + . = e3; + .data : + { + d1 = 4; + . += d1 + 5 << 2; + d2 = .; + s_diff = d2 - d1; + s_sum_neg = d2 + -d1; + s_sum = d2 + d1; + s_prod = d2 * d1; + s1 = d1 - 2; + s2 = d2 % 5; + s3 = d2 / 5; + s4 = ABSOLUTE (d1) - 2; + s5 = ABSOLUTE (d2) % 5; + s6 = ABSOLUTE (d2) / 5; + } + /DISCARD/ : {*(*)} + +diff = d2 - d1; +sum_neg = d2 + -d1; +sum = d2 + d1; +prod = d2 * d1; +x1 = d1 - 2; +x2 = d2 % 5; +x3 = d2 / 5; +x4 = ABSOLUTE (d1) - 2; +x5 = ABSOLUTE (d2) % 5; +x6 = ABSOLUTE (d2) / 5; +}