diff mbox

[4/4] Add tests for 64bit values in trace-condition.exp

Message ID 1463504594-4419-4-git-send-email-antoine.tremblay@ericsson.com
State New
Headers show

Commit Message

Antoine Tremblay May 17, 2016, 5:03 p.m. UTC
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/gdb.trace/trace-condition.exp | 36 +++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

Comments

Pedro Alves May 27, 2016, 12:08 p.m. UTC | #1
On 05/17/2016 06:03 PM, Antoine Tremblay wrote:
> 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/gdb.trace/trace-condition.exp | 36 +++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 
> diff --git a/gdb/testsuite/gdb.trace/trace-condition.exp b/gdb/testsuite/gdb.trace/trace-condition.exp
> index 8c770f4..4e129e8 100644
> --- a/gdb/testsuite/gdb.trace/trace-condition.exp
> +++ b/gdb/testsuite/gdb.trace/trace-condition.exp
> @@ -163,4 +163,40 @@ foreach trace_command { "trace" "ftrace" } {
>      test_tracepoints $trace_command "(42 >= 42 ? 0 : 1) == 0" 10
>      test_tracepoints $trace_command "(42 > 21 ? 0 : 1) == 0" 10 18955_i386_failure
>      test_tracepoints $trace_command "\$trace_timestamp >= 0" 10
> +
> +    #Test operations with 64 bit operands.

Space after # ?  More instances below.

(And same comment as previous patches.)

Thanks,
Pedro Alves
Antoine Tremblay May 27, 2016, 12:36 p.m. UTC | #2
Pedro Alves writes:

> On 05/17/2016 06:03 PM, Antoine Tremblay wrote:
>> 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/gdb.trace/trace-condition.exp | 36 +++++++++++++++++++++++++++++
>>  1 file changed, 36 insertions(+)
>> 
>> diff --git a/gdb/testsuite/gdb.trace/trace-condition.exp b/gdb/testsuite/gdb.trace/trace-condition.exp
>> index 8c770f4..4e129e8 100644
>> --- a/gdb/testsuite/gdb.trace/trace-condition.exp
>> +++ b/gdb/testsuite/gdb.trace/trace-condition.exp
>> @@ -163,4 +163,40 @@ foreach trace_command { "trace" "ftrace" } {
>>      test_tracepoints $trace_command "(42 >= 42 ? 0 : 1) == 0" 10
>>      test_tracepoints $trace_command "(42 > 21 ? 0 : 1) == 0" 10 18955_i386_failure
>>      test_tracepoints $trace_command "\$trace_timestamp >= 0" 10
>> +
>> +    #Test operations with 64 bit operands.
>
> Space after # ?  More instances below.

Fixed, thanks.

>
> (And same comment as previous patches.)

Yep.
diff mbox

Patch

diff --git a/gdb/testsuite/gdb.trace/trace-condition.exp b/gdb/testsuite/gdb.trace/trace-condition.exp
index 8c770f4..4e129e8 100644
--- a/gdb/testsuite/gdb.trace/trace-condition.exp
+++ b/gdb/testsuite/gdb.trace/trace-condition.exp
@@ -163,4 +163,40 @@  foreach trace_command { "trace" "ftrace" } {
     test_tracepoints $trace_command "(42 >= 42 ? 0 : 1) == 0" 10
     test_tracepoints $trace_command "(42 > 21 ? 0 : 1) == 0" 10 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 == 0" 10
+    test_tracepoints $trace_command "0xababababcdcdcdcd + 0x1111111143434343 == 0xbcbcbcbd11111110" 10
+    test_tracepoints $trace_command "0xababababcdcdcdcd - 0x11111111dc111111 == 0x9a9a9a99f1bcbcbc" 10
+    test_tracepoints $trace_command "0xababababcdcdcdcd * 0xababababcdcdcdcd == 0x55320eeb91c3f629" 10
+    test_tracepoints $trace_command "0x00abababcdcdcdcd << 1 == 0x15757579b9b9b9a" 10
+    test_tracepoints $trace_command "0x00abababcdcdcdcd << 46 == 0x7373400000000000" 10
+    #signed rsh
+    test_tracepoints $trace_command "0x00abababcdcdcdcd >> 1 == 0x55d5d5e6e6e6e6" 10
+    test_tracepoints $trace_command "0x00abababcdcdcdcd >> 46 == 0x2ae" 10
+    #unsigned rsh
+    test_tracepoints $trace_command "0xababababcdcdcdcdUL >> 1 == 0x55d5d5d5e6e6e6e6UL" 10
+    test_tracepoints $trace_command "0xababababcdcdcdcdUL >> 46 == 0x2aeaeUL" 10
+    test_tracepoints $trace_command "-(0x00abababcdcdcdcd << 1) == -0x15757579b9b9b9a" 10
+    test_tracepoints $trace_command "-(0x00abababcdcdcdcd >> 1) == -0x55d5d5e6e6e6e6" 10
+    test_tracepoints $trace_command "(0xababababcdcdcdcd & 0x00000fffffffffff) == 0x00000babcdcdcdcd" 10
+    test_tracepoints $trace_command "(0xababababcdcdcdcd | 0x00000fffffffffff) == 0xababafffffffffff" 10
+    test_tracepoints $trace_command "(0xaaaaaaaaaaaaaaaa ^ 0x5555555555555555) == 0xffffffffffffffff" 10
+    test_tracepoints $trace_command "~0xaaaaaaaaaaaaaaaa == 0x5555555555555555" 10
+    #less unsigned
+    test_tracepoints $trace_command "0x99999999bbbbbbbb < 0xaaaaaaaaaaaaaaaa" 10
+    test_tracepoints $trace_command "0x99999999bbbbbbbb < 0x99999999cccccccc" 10
+    test_tracepoints $trace_command "0x99999999bbbbbbbb <= 0x99999999bbbbbbbb" 10
+    #less signed
+    test_tracepoints $trace_command "0x09999999bbbbbbbb < 0x0aaaaaaaaaaaaaaa" 10
+    test_tracepoints $trace_command "0x09999999bbbbbbbb < 0x09999999cccccccc" 10
+    test_tracepoints $trace_command "0x09999999bbbbbbbb <= 0x09999999bbbbbbbb" 10
+    test_tracepoints $trace_command "0x0aaaaaaaaaaaaaaa > 0x09999999bbbbbbbb" 10
+    test_tracepoints $trace_command "(0xabababab00000000 == 0xcdcdcdcd00000000 ? 1 : 0) == 0" 10
+    test_tracepoints $trace_command "(0xabababab00000000 != 0xcdcdcdcd00000000 ? 1 : 0) == 1" 10
+    test_tracepoints $trace_command "(0x09999999bbbbbbbb < 0x09999999cccccccc ? 1 : 0) == 1" 10 18955_i386_failure
+    test_tracepoints $trace_command "(0x09999999bbbbbbbb <= 0x09999999bbbbbbbb ? 1 : 0) == 1" 10
+    test_tracepoints $trace_command "(0x09999999bbbbbbbb >= 0x09999999bbbbbbbb ? 1 : 0) == 1" 10
+    test_tracepoints $trace_command "(0x0aaaaaaaaaaaaaaa > 0x09999999bbbbbbbb ? 1 : 0) == 1" 10
 }