1
Fork 0

Update test.

This commit is contained in:
Camille GILLOT 2020-11-23 18:05:36 +01:00
parent 032f68d625
commit 044a986015

View file

@ -13,114 +13,99 @@
#![feature(rustc_attrs)]
#![feature(unboxed_closures)]
#![feature(link_args)]
#![crate_type="rlib"]
#![crate_type = "rlib"]
// Change function name --------------------------------------------------------
#[cfg(cfail1)]
extern {
extern "C" {
pub fn change_function_name1(c: i64) -> i32;
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
extern {
#[rustc_dirty(cfg = "cfail2", except = "hir_owner_nodes")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn change_function_name2(c: i64) -> i32;
}
// Change parameter name -------------------------------------------------------
#[cfg(cfail1)]
extern {
extern "C" {
pub fn change_parameter_name(c: i64) -> i32;
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
extern {
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn change_parameter_name(d: i64) -> i32;
}
// Change parameter type -------------------------------------------------------
#[cfg(cfail1)]
extern {
extern "C" {
pub fn change_parameter_type(c: i64) -> i32;
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
extern {
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn change_parameter_type(c: i32) -> i32;
}
// Change return type ----------------------------------------------------------
#[cfg(cfail1)]
extern {
extern "C" {
pub fn change_return_type(c: i32) -> i32;
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
extern {
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn change_return_type(c: i32) -> i8;
}
// Add parameter ---------------------------------------------------------------
#[cfg(cfail1)]
extern {
extern "C" {
pub fn add_parameter(c: i32) -> i32;
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
extern {
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn add_parameter(c: i32, d: i32) -> i32;
}
// Add return type -------------------------------------------------------------
#[cfg(cfail1)]
extern {
extern "C" {
pub fn add_return_type(c: i32);
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
extern {
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn add_return_type(c: i32) -> i32;
}
// Make function variadic ------------------------------------------------------
#[cfg(cfail1)]
extern {
extern "C" {
pub fn make_function_variadic(c: i32);
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
extern {
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn make_function_variadic(c: i32, ...);
}
// Change calling convention ---------------------------------------------------
#[cfg(cfail1)]
extern "C" {
@ -128,74 +113,66 @@ extern "C" {
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_dirty(cfg = "cfail2", except = "hir_owner_nodes")]
#[rustc_clean(cfg = "cfail3")]
extern "rust-call" {
pub fn change_calling_convention(c: i32);
}
// Make function public --------------------------------------------------------
#[cfg(cfail1)]
extern {
extern "C" {
fn make_function_public(c: i32);
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
extern {
#[rustc_dirty(cfg = "cfail2", except = "hir_owner_nodes")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn make_function_public(c: i32);
}
// Add function ----------------------------------------------------------------
#[cfg(cfail1)]
extern {
extern "C" {
pub fn add_function1(c: i32);
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
extern {
#[rustc_dirty(cfg = "cfail2", except = "hir_owner_nodes")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn add_function1(c: i32);
pub fn add_function2();
}
// Change link-args ------------------------------------------------------------
#[cfg(cfail1)]
#[link_args = "-foo -bar"]
extern {
extern "C" {
pub fn change_link_args(c: i32);
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_dirty(cfg = "cfail2", except = "hir_owner_nodes")]
#[rustc_clean(cfg = "cfail3")]
#[link_args = "-foo -bar -baz"]
extern {
extern "C" {
pub fn change_link_args(c: i32);
}
// Change link-name ------------------------------------------------------------
#[cfg(cfail1)]
#[link(name = "foo")]
extern {
extern "C" {
pub fn change_link_name(c: i32);
}
#[cfg(not(cfail1))]
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
#[rustc_dirty(cfg = "cfail2", except = "hir_owner_nodes")]
#[rustc_clean(cfg = "cfail3")]
#[link(name = "bar")]
extern {
extern "C" {
pub fn change_link_name(c: i32);
}
@ -209,15 +186,13 @@ mod indirectly_change_parameter_type {
#[cfg(not(cfail1))]
use super::c_i64 as c_int;
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
extern {
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn indirectly_change_parameter_type(c: c_int);
}
}
// Indirectly change return type --------------------------------------------
mod indirectly_change_return_type {
#[cfg(cfail1)]
@ -225,9 +200,9 @@ mod indirectly_change_return_type {
#[cfg(not(cfail1))]
use super::c_i64 as c_int;
#[rustc_dirty(cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
extern {
#[rustc_dirty(cfg = "cfail2", except = "hir_owner,hir_owner_nodes")]
#[rustc_clean(cfg = "cfail3")]
extern "C" {
pub fn indirectly_change_return_type() -> c_int;
}
}