mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Port argument-non-c-like-enum to Rust
This commit is contained in:
parent
142d02d472
commit
fd7bc59363
@ -1,8 +0,0 @@
|
||||
# ignore-cross-compile
|
||||
include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) --crate-type=staticlib nonclike.rs
|
||||
$(CC) test.c $(call STATICLIB,nonclike) $(call OUT_EXE,test) \
|
||||
$(EXTRACFLAGS) $(EXTRACXXFLAGS)
|
||||
$(call RUN,test)
|
20
tests/run-make/arguments-non-c-like-enum/rmake.rs
Normal file
20
tests/run-make/arguments-non-c-like-enum/rmake.rs
Normal file
@ -0,0 +1,20 @@
|
||||
//! Check that non-trivial `repr(C)` enum in Rust has valid C layout.
|
||||
//@ ignore-cross-compile
|
||||
|
||||
extern crate run_make_support;
|
||||
|
||||
use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib};
|
||||
|
||||
pub fn main() {
|
||||
use std::path::Path;
|
||||
|
||||
rustc().input("nonclike.rs").crate_type("staticlib").run();
|
||||
cc().input("test.c")
|
||||
.input(static_lib("nonclike"))
|
||||
.out_exe("test")
|
||||
.args(&extra_c_flags())
|
||||
.args(&extra_cxx_flags())
|
||||
.inspect(|cmd| eprintln!("{cmd:?}"))
|
||||
.run();
|
||||
run("test");
|
||||
}
|
Loading…
Reference in New Issue
Block a user