[PATCH] Avoid running one Rust test against older LLVM

Pedro Alves pedro@palves.net
Mon Sep 14 10:49:45 GMT 2020


On 9/10/20 7:42 PM, Tom Tromey wrote:

> +# Return the version of LLVM used by the Rust compiler.  Note that
> +# older versions of rustc don't print this -- in this case the
> +# returned version is "0.0".
> +gdb_caching_proc rust_llvm_version {
> +    set rustc [find_rustc]
> +    set output [lindex [remote_exec host "$rustc --version --verbose"] 1]

Pedantically I think it would be better to avoid executing
" --version --verbose" when find_rustc returns "".

Pedro Alves

> +    foreach line [split $output \n] {
> +	if {[regexp "LLVM version: (.+)\$" $output ignore version]} {
> +	    return $version
> +	}
> +    }
> +    verbose "could not match rustc version output: $output"
> +    return 0.0
> +}



More information about the Gdb-patches mailing list