Skip to content

Commit f7d67d6

Browse files
committed
rewrite extern-fn-with-packed-struct to rmake
1 parent bde9178 commit f7d67d6

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
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
@@ -27,7 +27,6 @@ run-make/extern-flag-disambiguates/Makefile
2727
run-make/extern-fn-generic/Makefile
2828
run-make/extern-fn-mangle/Makefile
2929
run-make/extern-fn-reachable/Makefile
30-
run-make/extern-fn-with-packed-struct/Makefile
3130
run-make/extern-fn-with-union/Makefile
3231
run-make/extern-multiple-copies/Makefile
3332
run-make/extern-multiple-copies2/Makefile

tests/run-make/extern-fn-with-packed-struct/Makefile

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Packed structs, in C, occupy less bytes in memory, but are more
2+
// vulnerable to alignment errors. Passing them around in a Rust-C foreign
3+
// function interface (FFI) would cause unexpected behavior, until this was
4+
// fixed in #16584. This test checks that a Rust program with a C library
5+
// compiles and executes successfully, even with usage of a packed struct.
6+
// See https://github.com/rust-lang/rust/issues/16574
7+
8+
//@ ignore-cross-compile
9+
// Reason: the compiled binary is executed
10+
11+
use run_make_support::{build_native_static_lib, run, rustc};
12+
13+
fn main() {
14+
build_native_static_lib("test");
15+
rustc().input("test.rs").run();
16+
run("test");
17+
}

0 commit comments

Comments
 (0)