From 825c8ef28fc669bdf4eab64b43d7a64761fbd677 Mon Sep 17 00:00:00 2001 From: Antoine Tremblay Date: Mon, 30 May 2016 11:24:44 -0400 Subject: [PATCH] Add tests for 64bit values in trace-condition.exp This patch adds tests for emit operations with 64 bit values. It takes special care to avoid mistakes that one could make on a 32bit architecture using 64bit values. gdb/testsuite/ChangeLog: * gdb.trace/trace-condition.exp: Add 64bit tests. --- gdb/testsuite/ChangeLog | 4 + gdb/testsuite/gdb.trace/trace-condition.exp | 95 +++++++++++++++++++++ 2 files changed, 99 insertions(+) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 7bf94643ccf..b91ddce2c5f 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-05-30 Antoine Tremblay + + * gdb.trace/trace-condition.exp: Add 64bit tests. + 2016-05-30 Antoine Tremblay * gdb.trace/trace-condition.c (marker): Adapt signature to 8 to 64 diff --git a/gdb/testsuite/gdb.trace/trace-condition.exp b/gdb/testsuite/gdb.trace/trace-condition.exp index 6f4413d9543..e36dba42fc9 100644 --- a/gdb/testsuite/gdb.trace/trace-condition.exp +++ b/gdb/testsuite/gdb.trace/trace-condition.exp @@ -207,4 +207,99 @@ foreach trace_command { "trace" "ftrace" } { test_tracepoints $trace_command "(11 > 21 ? 0 : 1) == 0" 0 18955_i386_failure test_tracepoints $trace_command "\$trace_timestamp >= 0" 10 + + # Test operations with 64 bit operands. + test_tracepoints $trace_command "0xabababab00000000 == 0xcdcdcdcd00000000" 0 + test_tracepoints $trace_command "0xabababab00000000 == 0xabababab00000000" 10 + + test_tracepoints $trace_command "!0xabababab00000000 == 0" 10 + test_tracepoints $trace_command "!0x0 == 0" 0 + + test_tracepoints $trace_command "0xababababcdcdcdcd + 0x1111111143434343 == 0xbcbcbcbd11111110" 10 + test_tracepoints $trace_command "0xababababcdcdcdff + 0x1111111143434343 == 0xbcbcbcbd11111110" 0 + + test_tracepoints $trace_command "0xababababcdcdcdcd - 0x11111111dc111111 == 0x9a9a9a99f1bcbcbc" 10 + test_tracepoints $trace_command "0xababababcdcdcdff - 0x11111111dc111111 == 0x9a9a9a99f1bcbcbc" 0 + + test_tracepoints $trace_command "0xababababcdcdcdcd * 0xababababcdcdcdcd == 0x55320eeb91c3f629" 10 + test_tracepoints $trace_command "0xababababcdcdcdff * 0xababababcdcdcdcd == 0x55320eeb91c3f629" 0 + + test_tracepoints $trace_command "0x00abababcdcdcdcd << 1 == 0x15757579b9b9b9a" 10 + test_tracepoints $trace_command "0x00abababcdcdcdff << 1 == 0x15757579b9b9b9a" 0 + + test_tracepoints $trace_command "0x00abababcdcdcdcd << 46 == 0x7373400000000000" 10 + test_tracepoints $trace_command "0x00abababcdcdcdff << 46 == 0x7373400000000000" 0 + + # signed rsh + test_tracepoints $trace_command "0x00abababcdcdcdcd >> 1 == 0x55d5d5e6e6e6e6" 10 + test_tracepoints $trace_command "0x00bcababcdcdcdcd >> 1 == 0x55d5d5e6e6e6e6" 0 + + test_tracepoints $trace_command "0x00abababcdcdcdcd >> 46 == 0x2ae" 10 + test_tracepoints $trace_command "0x00bcababcdcdcdcd >> 46 == 0x2ae" 0 + + # unsigned rsh + test_tracepoints $trace_command "0xababababcdcdcdcdUL >> 1 == 0x55d5d5d5e6e6e6e6UL" 10 + test_tracepoints $trace_command "0xcdabababcdcdcdcdUL >> 1 == 0x55d5d5d5e6e6e6e6UL" 0 + + test_tracepoints $trace_command "0xababababcdcdcdcdUL >> 46 == 0x2aeaeUL" 10 + test_tracepoints $trace_command "0xcdabababcdcdcdcdUL >> 46 == 0x2aeaeUL" 0 + + test_tracepoints $trace_command "-(0x00abababcdcdcdcd << 1) == -0x15757579b9b9b9a" 10 + test_tracepoints $trace_command "-(0x00abababcdcdcdff << 1) == -0x15757579b9b9b9a" 0 + + test_tracepoints $trace_command "-(0x00abababcdcdcdcd >> 1) == -0x55d5d5e6e6e6e6" 10 + test_tracepoints $trace_command "-(0x00cdababcdcdcdcd >> 1) == -0x55d5d5e6e6e6e6" 0 + + test_tracepoints $trace_command "(0xababababcdcdcdcd & 0x00000fffffffffff) == 0x00000babcdcdcdcd" 10 + test_tracepoints $trace_command "(0xababababcdcdcdcd & 0x00000fffffffff00) == 0x00000babcdcdcdcd" 0 + + test_tracepoints $trace_command "(0xababababcdcdcdcd | 0x00000fffffffffff) == 0xababafffffffffff" 10 + test_tracepoints $trace_command "(0xababababcdcdcdcd | 0x00000fffffffff00) == 0xababafffffffffff" 0 + + test_tracepoints $trace_command "(0xaaaaaaaaaaaaaaaa ^ 0x5555555555555555) == 0xffffffffffffffff" 10 + test_tracepoints $trace_command "(0xaaaaaaaaaaaaaaaa ^ 0x5555555555555111) == 0xffffffffffffffff" 0 + + test_tracepoints $trace_command "~0xaaaaaaaaaaaaaaaa == 0x5555555555555555" 10 + test_tracepoints $trace_command "~0xaaaaaaaaaaaaaaaa == 0x5555555555555111" 0 + + # less unsigned + test_tracepoints $trace_command "0x99999999bbbbbbbb < 0xaaaaaaaaaaaaaaaa" 10 + test_tracepoints $trace_command "0xbb999999bbbbbbbb < 0xaaaaaaaaaaaaaaaa" 0 + + test_tracepoints $trace_command "0x99999999bbbbbbbb < 0x99999999cccccccc" 10 + test_tracepoints $trace_command "0x99999999eebbbbbb < 0x99999999cccccccc" 0 + + test_tracepoints $trace_command "0x99999999bbbbbbbb <= 0x99999999bbbbbbbb" 10 + test_tracepoints $trace_command "0xbb999999eebbbbbb <= 0x99999999bbbbbbbb" 0 + + # less signed + test_tracepoints $trace_command "0x09999999bbbbbbbb < 0x0aaaaaaaaaaaaaaa" 10 + test_tracepoints $trace_command "0x0bb99999ccbbbbbb < 0x0aaaaaaaaaaaaaaa" 0 + + test_tracepoints $trace_command "0x09999999bbbbbbbb < 0x09999999cccccccc" 10 + test_tracepoints $trace_command "0x09999999ddbbbbbb < 0x09999999cccccccc" 0 + + test_tracepoints $trace_command "0x09999999bbbbbbbb <= 0x09999999bbbbbbbb" 10 + test_tracepoints $trace_command "0x0aa99999bbbbbbbb <= 0x09999999bbbbbbbb" 0 + + test_tracepoints $trace_command "0x0aaaaaaaaaaaaaaa > 0x09999999bbbbbbbb" 10 + test_tracepoints $trace_command "0x088aaaaabbaaaaaa > 0x09999999bbbbbbbb" 0 + + test_tracepoints $trace_command "(0xabababab00000000 == 0xcdcdcdcd00000000 ? 1 : 0) == 0" 10 + test_tracepoints $trace_command "(0xcdcdcdcd00000000 == 0xcdcdcdcd00000000 ? 1 : 0) == 0" 0 + + test_tracepoints $trace_command "(0xabababab00000000 != 0xcdcdcdcd00000000 ? 1 : 0) == 1" 10 + test_tracepoints $trace_command "(0xcdcdcdcd00000000 != 0xcdcdcdcd00000000 ? 1 : 0) == 1" 0 + + test_tracepoints $trace_command "(0x09999999bbbbbbbb < 0x09999999cccccccc ? 1 : 0) == 1" 10 18955_i386_failure + test_tracepoints $trace_command "(0x09999999eeebbbbb < 0x09999999cccccccc ? 1 : 0) == 1" 0 18955_i386_failure + + test_tracepoints $trace_command "(0x09999999bbbbbbbb <= 0x09999999bbbbbbbb ? 1 : 0) == 1" 10 + test_tracepoints $trace_command "(0x09999999eeebbbbb <= 0x09999999bbbbbbbb ? 1 : 0) == 1" 0 + + test_tracepoints $trace_command "(0x09999999bbbbbbbb >= 0x09999999bbbbbbbb ? 1 : 0) == 1" 10 + test_tracepoints $trace_command "(0x00099999bbbbbbbb >= 0x09999999bbbbbbbb ? 1 : 0) == 1" 0 + + test_tracepoints $trace_command "(0x0aaaaaaaaaaaaaaa > 0x09999999bbbbbbbb ? 1 : 0) == 1" 10 + test_tracepoints $trace_command "(0x00088888ccaaaaaa > 0x09999999bbbbbbbb ? 1 : 0) == 1" 0 } -- 2.30.2