From 27001c664dddac8910b0a9ed55a94d6307e8a9e9 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Tue, 15 Sep 1998 22:25:01 +0000 Subject: Mon Sep 14 20:00:04 1998 Michael Snyder * lib/y (x->y->z, ...) + # x[2] (x[2][3], ...) (const index) + # x[y] (x[y][z], ...) (index to be char, short, long, float, double) + # NOTE: + # We test the following operators by using them in an array index + # expression -- because the naked result of an operator is not really + # collected. To be sure the operator was evaluated correctly on the + # target, we have to actually use the result eg. in an array offset + # calculation. + # x[y + z] (tests addition: y and z various combos of types, sclasses) + # x[y - z] (tests subtraction) (ditto) + # x[y * z] (tests multiplication) (ditto) + # x[y / z] (tests division) (ditto) + # x[y % z] (tests modulo division) (ditto) + # x[y == z] (tests equality relation) (ditto) UNSUPPORTED + # x[y != z] (tests inequality relation) (ditto) UNSUPPORTED + # x[y > z] (tests greater-than relation) (ditto) UNSUPPORTED + # x[y < z] (tests less-than relation) (ditto) UNSUPPORTED + # x[y >= z] (tests greater-than-or-equal relation) (ditto) UNSUPPORTED + # x[y <= z] (tests less-than-or-equal relation) (ditto) UNSUPPORTED + # x[y && z] (tests logical and) (ditto) UNSUPPORTED + # x[y || z] (tests logical or) (ditto) UNSUPPORTED + # x[y & z] (tests binary and) (ditto) UNSUPPORTED + # x[y | z] (tests binary or) (ditto) UNSUPPORTED + # x[y ^ z] (tests binary xor) (ditto) UNSUPPORTED + # x[y ? z1 : z2] (tests ternary operator) (ditto) UNSUPPORTED + # x[y << z] (tests shift-left) (ditto) UNSUPPORTED + # x[y >> z] (tests shift-right) (ditto) UNSUPPORTED + # x[y = z] (tests assignment operator) (ditto) UNSUPPORTED + # x[++y] (tests pre-increment operator) (ditto) UNSUPPORTED + # x[--y] (tests pre-decrement operator) (ditto) UNSUPPORTED + # x[y++] (tests post-increment operator) (ditto) UNSUPPORTED + # x[y--] (tests post-decrement operator) (ditto) UNSUPPORTED + # x[+y] (tests unary plus) (ditto) + # x[-y] (tests unary minus) (ditto) + # x[!y] (tests logical not) (ditto) UNSUPPORTED + # x[~y] (tests binary not) (ditto) UNSUPPORTED + # x[(y, z)] (tests comma expression) (ditto) + # cast expr + # stack data + + gdb_collect_expression_test globals_test_func \ + "globalstruct.memberi" "82" "a.b" + gdb_collect_expression_test globals_test_func \ + "globalp->memberc" "81 'Q'" "a->b" + gdb_collect_expression_test globals_test_func \ + "globalarr\[2\]" "2" "a\[2\]" + gdb_collect_expression_test globals_test_func \ + "globalarr\[l3\]" "3" "a\[b\]" + gdb_collect_expression_test globals_test_func \ + "globalarr\[l3 + l2\]" "5" "a\[b + c\]" + gdb_collect_expression_test globals_test_func \ + "globalarr\[l3 - l2\]" "1" "a\[b - c\]" + gdb_collect_expression_test globals_test_func \ + "globalarr\[l3 * l2\]" "6" "a\[b * c\]" + gdb_collect_expression_test globals_test_func \ + "globalarr\[l6 / l3\]" "2" "a\[b / c\]" + gdb_collect_expression_test globals_test_func \ + "globalarr\[l7 % l3\]" "1" "a\[b % c\]" + gdb_collect_expression_test globals_test_func \ + "globalarr\[+l1\]" "1" "a\[+b\]" + gdb_collect_expression_test globals_test_func \ + "globalarr\[-lminus\]" "2" "a\[-b\]" + gdb_collect_expression_test globals_test_func \ + "globalarr\[\(l6, l7\)\]" "7" "a\[\(b, c\)\]" + +} + +# Start with a fresh gdb. + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load $binfile + +if [target_info exists gdb_stub] { + gdb_step_for_stub; +} + +# Body of test encased in a proc so we can return prematurely. +gdb_trace_collection_test + +# Finished! +gdb_test "tfind none" "" "" + + + -- cgit v1.1