Test std::env::args in a staticlib on glibc Linux
This commit is contained in:
parent
d448ab0cf1
commit
c6bcea965d
3 changed files with 23 additions and 0 deletions
12
src/test/run-make-fulldeps/glibc-staticlib-args/Makefile
Normal file
12
src/test/run-make-fulldeps/glibc-staticlib-args/Makefile
Normal file
|
@ -0,0 +1,12 @@
|
|||
# only-gnu
|
||||
# only-linux
|
||||
|
||||
-include ../tools.mk
|
||||
|
||||
# This ensures that std::env::args works in a library called from C on glibc Linux.
|
||||
|
||||
all:
|
||||
$(RUSTC) --crate-type=staticlib library.rs
|
||||
$(CC) program.c $(call STATICLIB,library) $(call OUT_EXE,program) \
|
||||
$(EXTRACFLAGS) $(EXTRACXXFLAGS)
|
||||
$(call RUN,program)
|
|
@ -0,0 +1,4 @@
|
|||
#[no_mangle]
|
||||
pub extern fn args_check() {
|
||||
assert_ne!(std::env::args_os().count(), 0);
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
// ignore-license
|
||||
void args_check();
|
||||
|
||||
int main() {
|
||||
args_check();
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue