This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +50
-32
lines changed
raw-fn-pointer-opt-undefined-behavior Expand file tree Collapse file tree 8 files changed +50
-32
lines changed Original file line number Diff line number Diff line change @@ -55,13 +55,11 @@ run-make/incr-foreign-head-span/Makefile
5555run-make/interdependent-c-libraries/Makefile
5656run-make/intrinsic-unreachable/Makefile
5757run-make/invalid-library/Makefile
58- run-make/invalid-so/Makefile
5958run-make/issue-107094/Makefile
6059run-make/issue-109934-lto-debuginfo/Makefile
6160run-make/issue-14698/Makefile
6261run-make/issue-15460/Makefile
6362run-make/issue-18943/Makefile
64- run-make/issue-20626/Makefile
6563run-make/issue-22131/Makefile
6664run-make/issue-25581/Makefile
6765run-make/issue-26006/Makefile
@@ -97,7 +95,6 @@ run-make/long-linker-command-lines-cmd-exe/Makefile
9795run-make/long-linker-command-lines/Makefile
9896run-make/longjmp-across-rust/Makefile
9997run-make/lto-dylib-dep/Makefile
100- run-make/lto-empty/Makefile
10198run-make/lto-linkage-used-attr/Makefile
10299run-make/lto-no-link-whole-rlib/Makefile
103100run-make/lto-smoke-c/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ // When a fake library was given to the compiler, it would
2+ // result in an obscure and unhelpful error message. This test
3+ // creates a false "foo" dylib, and checks that the standard error
4+ // explains that the file exists, but that its metadata is incorrect.
5+ // See https://github.com/rust-lang/rust/pull/88368
6+
7+ use run_make_support:: { dynamic_lib_name, fs_wrapper, rustc} ;
8+
9+ fn main ( ) {
10+ fs_wrapper:: create_file ( dynamic_lib_name ( "foo" ) ) ;
11+ rustc ( )
12+ . crate_type ( "lib" )
13+ . extern_ ( "foo" , dynamic_lib_name ( "foo" ) )
14+ . input ( "bar.rs" )
15+ . run_fail ( )
16+ . assert_stderr_contains ( "invalid metadata files for crate `foo`" ) ;
17+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ // Compiling Rust code twice in a row with "fat" link-time-optimizations used to cause
2+ // an internal compiler error (ICE). This was due to how the compiler would cache some modules
3+ // to make subsequent compilations faster, at least one of which was required for LTO to link
4+ // into. After this was patched in #63956, this test checks that the bug does not make
5+ // a resurgence.
6+ // See https://github.com/rust-lang/rust/issues/63349
7+
8+ //@ ignore-cross-compile
9+
10+ use run_make_support:: rustc;
11+
12+ fn main ( ) {
13+ rustc ( ) . input ( "lib.rs" ) . arg ( "-Clto=fat" ) . opt_level ( "3" ) . incremental ( "inc-fat" ) . run ( ) ;
14+ rustc ( ) . input ( "lib.rs" ) . arg ( "-Clto=fat" ) . opt_level ( "3" ) . incremental ( "inc-fat" ) . run ( ) ;
15+ rustc ( ) . input ( "lib.rs" ) . arg ( "-Clto=thin" ) . opt_level ( "3" ) . incremental ( "inc-thin" ) . run ( ) ;
16+ rustc ( ) . input ( "lib.rs" ) . arg ( "-Clto=thin" ) . opt_level ( "3" ) . incremental ( "inc-thin" ) . run ( ) ;
17+ }
File renamed without changes.
Original file line number Diff line number Diff line change 1+ // Despite the absence of any unsafe Rust code, foo.rs in this test would,
2+ // because of the raw function pointer,
3+ // cause undefined behavior and fail to print the expected result, "4" -
4+ // only when activating optimizations (opt-level 2). This test checks
5+ // that this bug does not make a resurgence.
6+ // Note that the bug cannot be observed in an assert_eq!, only in the stdout.
7+ // See https://github.com/rust-lang/rust/issues/20626
8+
9+ //@ ignore-cross-compile
10+
11+ use run_make_support:: { run, rustc} ;
12+
13+ fn main ( ) {
14+ rustc ( ) . input ( "foo.rs" ) . opt ( ) . run ( ) ;
15+ run ( "foo" ) . assert_stdout_equals ( "4" ) ;
16+ }
You can’t perform that action at this time.
0 commit comments