[PATCH] rust: Fix rust modules test
Tom de Vries
tdevries@suse.de
Mon Jul 6 09:32:00 GMT 2020
On 7/4/20 5:27 AM, Daniel Xu wrote:
> I noticed that the modules test was failing. Some choice use of `nm`
> revealed `TWENTY_THREE` was not in the final binary. Rather than trying
> to trick the compiler/linker by using magic flags, simply `println!()`
> the global.
>
> gdb/testsuite/
I cannot judge about the patch itself, but the FAIL was filed as
PR26121, so please add here: "PR rust/26121".
Thanks,
- Tom
> * gdb.rust/modules.rs: Prevent linker from discarding test
> symbol
>
> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
> ---
> gdb/testsuite/gdb.rust/modules.rs | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/gdb/testsuite/gdb.rust/modules.rs b/gdb/testsuite/gdb.rust/modules.rs
> index 6db082817b..dc2a469b2f 100644
> --- a/gdb/testsuite/gdb.rust/modules.rs
> +++ b/gdb/testsuite/gdb.rust/modules.rs
> @@ -93,4 +93,7 @@ pub mod mod1 {
>
> fn main () {
> mod1::inner::innest::f1();
> +
> + // Prevent linker from discarding `TWENTY_THREE`
> + println!("{}", TWENTY_THREE);
> }
>
More information about the Gdb-patches
mailing list