aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorAntoine Tremblay <antoine.tremblay@ericsson.com>2016-05-30 11:24:44 -0400
committerAntoine Tremblay <antoine.tremblay@ericsson.com>2016-05-30 12:51:13 -0400
commit825c8ef28fc669bdf4eab64b43d7a64761fbd677 (patch)
tree49e00832a67bcb638683c1271bd6ac24b73fe6b5 /gdb/testsuite
parent2320162a6219c664a8da2e2ff68b08d6f6c2ffcc (diff)
downloadgdb-825c8ef28fc669bdf4eab64b43d7a64761fbd677.zip
gdb-825c8ef28fc669bdf4eab64b43d7a64761fbd677.tar.gz
gdb-825c8ef28fc669bdf4eab64b43d7a64761fbd677.tar.bz2
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.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.trace/trace-condition.exp95
2 files changed, 99 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 7bf9464..b91ddce 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
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
bits types.
(main): Adapt to 8 to 64 bits types.
diff --git a/gdb/testsuite/gdb.trace/trace-condition.exp b/gdb/testsuite/gdb.trace/trace-condition.exp
index 6f4413d..e36dba4 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
}