Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 01c7118

Browse files
committed
rewrite extern-fn-with-union to rmake
1 parent 8a09f22 commit 01c7118

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ run-make/export-executable-symbols/Makefile
2121
run-make/extern-diff-internal-name/Makefile
2222
run-make/extern-flag-disambiguates/Makefile
2323
run-make/extern-fn-reachable/Makefile
24-
run-make/extern-fn-with-union/Makefile
2524
run-make/extern-multiple-copies/Makefile
2625
run-make/extern-multiple-copies2/Makefile
2726
run-make/fmt-write-bloat/Makefile

tests/run-make/extern-fn-generic/rmake.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// test simply runs a Rust program containing generics that is also reliant on
33
// a C library, and checks that compilation and execution are successful.
44
// See https://github.com/rust-lang/rust/pull/15831
5+
56
//@ ignore-cross-compile
67
// Reason: the compiled binary is executed
78

tests/run-make/extern-fn-with-union/Makefile

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// If an external function from foreign-function interface was called upon,
2+
// its attributes would only be passed to LLVM if and only if it was called in the same crate.
3+
// This caused passing around unions to be incorrect.
4+
// See https://github.com/rust-lang/rust/pull/14191
5+
6+
//@ ignore-cross-compile
7+
// Reason: the compiled binary is executed
8+
9+
use run_make_support::{build_native_static_lib, run, rustc};
10+
11+
fn main() {
12+
build_native_static_lib("ctest");
13+
rustc().input("testcrate.rs").run();
14+
rustc().input("test.rs").run();
15+
run("test");
16+
}

0 commit comments

Comments
 (0)