lint: Add test for no_mangle
This commit is contained in:
parent
d2ab7d3ea8
commit
ff25fd660a
|
@ -254,7 +254,6 @@ pub mod eabi {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle] // referenced from rust_try.ll
|
#[no_mangle] // referenced from rust_try.ll
|
||||||
#[allow(unexported_no_mangle)]
|
|
||||||
pub extern "C" fn rust_eh_personality_catch(
|
pub extern "C" fn rust_eh_personality_catch(
|
||||||
_version: c_int,
|
_version: c_int,
|
||||||
actions: uw::_Unwind_Action,
|
actions: uw::_Unwind_Action,
|
||||||
|
@ -293,7 +292,7 @@ pub mod eabi {
|
||||||
|
|
||||||
#[lang="eh_personality"]
|
#[lang="eh_personality"]
|
||||||
#[no_mangle] // referenced from rust_try.ll
|
#[no_mangle] // referenced from rust_try.ll
|
||||||
#[allow(unexported_no_mangle)]
|
#[allow(private_no_mangle_fns)]
|
||||||
pub extern "C" fn rust_eh_personality(
|
pub extern "C" fn rust_eh_personality(
|
||||||
version: c_int,
|
version: c_int,
|
||||||
actions: uw::_Unwind_Action,
|
actions: uw::_Unwind_Action,
|
||||||
|
@ -309,7 +308,6 @@ pub mod eabi {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle] // referenced from rust_try.ll
|
#[no_mangle] // referenced from rust_try.ll
|
||||||
#[allow(unexported_no_mangle)]
|
|
||||||
pub extern "C" fn rust_eh_personality_catch(
|
pub extern "C" fn rust_eh_personality_catch(
|
||||||
_version: c_int,
|
_version: c_int,
|
||||||
actions: uw::_Unwind_Action,
|
actions: uw::_Unwind_Action,
|
||||||
|
@ -348,7 +346,7 @@ pub mod eabi {
|
||||||
|
|
||||||
#[lang="eh_personality"]
|
#[lang="eh_personality"]
|
||||||
#[no_mangle] // referenced from rust_try.ll
|
#[no_mangle] // referenced from rust_try.ll
|
||||||
#[allow(unexported_no_mangle)]
|
#[allow(private_no_mangle_fns)]
|
||||||
extern "C" fn rust_eh_personality(
|
extern "C" fn rust_eh_personality(
|
||||||
state: uw::_Unwind_State,
|
state: uw::_Unwind_State,
|
||||||
ue_header: *mut uw::_Unwind_Exception,
|
ue_header: *mut uw::_Unwind_Exception,
|
||||||
|
@ -361,7 +359,6 @@ pub mod eabi {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle] // referenced from rust_try.ll
|
#[no_mangle] // referenced from rust_try.ll
|
||||||
#[allow(unexported_no_mangle)]
|
|
||||||
pub extern "C" fn rust_eh_personality_catch(
|
pub extern "C" fn rust_eh_personality_catch(
|
||||||
state: uw::_Unwind_State,
|
state: uw::_Unwind_State,
|
||||||
_ue_header: *mut uw::_Unwind_Exception,
|
_ue_header: *mut uw::_Unwind_Exception,
|
||||||
|
@ -439,7 +436,7 @@ pub mod eabi {
|
||||||
|
|
||||||
#[lang="eh_personality"]
|
#[lang="eh_personality"]
|
||||||
#[no_mangle] // referenced from rust_try.ll
|
#[no_mangle] // referenced from rust_try.ll
|
||||||
#[allow(unexported_no_mangle)]
|
#[allow(private_no_mangle_fns)]
|
||||||
extern "C" fn rust_eh_personality(
|
extern "C" fn rust_eh_personality(
|
||||||
exceptionRecord: *mut EXCEPTION_RECORD,
|
exceptionRecord: *mut EXCEPTION_RECORD,
|
||||||
establisherFrame: *mut c_void,
|
establisherFrame: *mut c_void,
|
||||||
|
@ -454,7 +451,6 @@ pub mod eabi {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle] // referenced from rust_try.ll
|
#[no_mangle] // referenced from rust_try.ll
|
||||||
#[allow(unexported_no_mangle)]
|
|
||||||
pub extern "C" fn rust_eh_personality_catch(
|
pub extern "C" fn rust_eh_personality_catch(
|
||||||
exceptionRecord: *mut EXCEPTION_RECORD,
|
exceptionRecord: *mut EXCEPTION_RECORD,
|
||||||
establisherFrame: *mut c_void,
|
establisherFrame: *mut c_void,
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
|
// compile-flags:-F private_no_mangle_fns
|
||||||
|
|
||||||
|
// FIXME(#19495) no_mangle'ing main ICE's.
|
||||||
|
#[no_mangle]
|
||||||
|
fn foo() { //~ ERROR function foo is marked #[no_mangle], but not exported
|
||||||
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub fn bar() {
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
foo();
|
||||||
|
bar();
|
||||||
|
}
|
Loading…
Reference in New Issue