Fix gdb.base/call-ar-st to work with Clang
When running gdb.base/call-ar-st.exp against Clang, we see one FAIL,
like so:
print_all_arrays (array_i=<main.integer_array>, array_c=<main.char_array> "ZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZa
ZaZaZaZaZaZaZaZaZaZaZaZa", array_f=<main.float_array>, array_d=<main.double_array>) at ../../../src/gdb/testsuite/gdb.base/call-ar-st.c:274
274 print_int_array(array_i); /* -step1- */
(gdb) FAIL: gdb.base/call-ar-st.exp: step inside print_all_arrays
With GCC we instead see:
print_all_arrays (array_i=<integer_array>, array_c=<char_array> "ZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZa", array_f=<float_array>, array_d=<double_array>) at /home/pedro/gdb/build/gdb/testsuite/../../../src/gdb/testsuite/gdb.base/call-ar-st.c:274
274 print_int_array(array_i); /* -step1- */
(gdb) PASS: gdb.base/call-ar-st.exp: step inside print_all_arrays
The difference is that with Clang we get:
array_i=<main.integer_array>, ...
instead of
array_i = <integer_array>, ...
These symbols are local static variables, and "main" is the name of
the function they are defined in. GCC instead appends a sequence
number to the linkage name:
$ nm -A call-ar-st.gcc | grep integer_
call-ar-st/call-ar-st:
00000000000061a0 b integer_array.3968
$ nm -A call-ar-st.clang | grep integer_
call-ar-st:
00000000004061a0 b main.integer_array
This commit changes the testcase to accept both outputs, as they are
functionally identical.
Co-Authored-By: Pedro Alves <pedro@palves.net>
Change-Id: Iaf2ccdb9d5996e0268ed12f595a6e04b368bfcb4