This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] Testsuite: Add gdb_can_simple_compile
>>>>> "Alan" == Alan Hayward <alan.hayward@arm.com> writes:
Alan> Simplfy gdb.exp by adding a function that will attempt to
Alan> compile a piece of code, then clean up.
Thank you. This looks like a good cleanup.
Alan> # A helper that compiles a test case to see if __int128 is supported.
Alan> proc gdb_int128_helper {lang} {
Alan> - set src [standard_temp_file i128[pid].c]
Alan> - set obj [standard_temp_file i128[pid].o]
Alan> -
Alan> - verbose -log "checking $lang for __int128"
Alan> - gdb_produce_source $src {
Alan> + return [gdb_can_simple_compile "i128-for-$lang" {
Alan> __int128 x;
Alan> int main() { return 0; }
Alan> - }
Alan> -
Alan> - set lines [gdb_compile $src $obj object [list nowarnings quiet $lang]]
Alan> - file delete $src
Alan> - file delete $obj
Alan> -
Alan> - set result [expr {!![string match "" $lines]}]
Alan> - verbose -log "__int128 for $lang result = $result"
Alan> - return $result
Alan> + } executable {$lang}]
This hunk seems incorrect -- it over-quotes $lang. I think instead the
{} around that should be removed.
This is ok with this fixed (or explained if I'm incorrect :).
Tom