Add tests for 64bit values in trace-condition.exp
authorAntoine Tremblay <antoine.tremblay@ericsson.com>
Mon, 30 May 2016 15:24:44 +0000 (11:24 -0400)
committerAntoine Tremblay <antoine.tremblay@ericsson.com>
Mon, 30 May 2016 16:51:13 +0000 (12:51 -0400)
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
gdb/testsuite/gdb.trace/trace-condition.exp

index 7bf94643ccfc7795fe34e622fc28843a01942502..b91ddce2c5f1977b8d81a730b84a26264ea6c6b0 100644 (file)
@@ -1,3 +1,7 @@
+2016-05-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
+
+       * gdb.trace/trace-condition.exp: Add 64bit tests.
+
 2016-05-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
 
        * gdb.trace/trace-condition.c (marker): Adapt signature to 8 to 64
index 6f4413d9543d509f55a6f94647913d75c2c53f02..e36dba42fc9d56ea28a94ce1191ce4dd99cc9187 100644 (file)
@@ -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
 }