From 12a8bc6eb916c3b8a61ad813c2e15aac8184c357 Mon Sep 17 00:00:00 2001 From: Daniel Klauer Date: Sat, 30 Sep 2017 13:48:12 +0200 Subject: rustc: Use 16bit c_int for msp430 Fix regression from c2fe69b9, where main() signature was changed from using 16bit isize to 32bit c_int for argc parameter/result. --- src/test/codegen/abi-main-signature-16bit-c-int.rs | 32 ++++++++++++++++++++++ src/test/codegen/abi-main-signature-32bit-c-int.rs | 20 ++++++++++++++ src/test/codegen/abi-main-signature.rs | 17 ------------ 3 files changed, 52 insertions(+), 17 deletions(-) create mode 100644 src/test/codegen/abi-main-signature-16bit-c-int.rs create mode 100644 src/test/codegen/abi-main-signature-32bit-c-int.rs delete mode 100644 src/test/codegen/abi-main-signature.rs (limited to 'src/test/codegen') diff --git a/src/test/codegen/abi-main-signature-16bit-c-int.rs b/src/test/codegen/abi-main-signature-16bit-c-int.rs new file mode 100644 index 00000000000..fbe2fd10e7a --- /dev/null +++ b/src/test/codegen/abi-main-signature-16bit-c-int.rs @@ -0,0 +1,32 @@ +// Copyright 2017 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Checks the signature of the implicitly generated native main() +// entry point. It must match C's `int main(int, char **)`. + +// This test is for targets with 16bit c_int only. +// ignore-aarch64 +// ignore-arm +// ignore-asmjs +// ignore-hexagon +// ignore-mips +// ignore-powerpc +// ignore-powerpc64 +// ignore-s390x +// ignore-sparc +// ignore-wasm32 +// ignore-x86 +// ignore-x86_64 +// ignore-xcore + +fn main() { +} + +// CHECK: define i16 @main(i16, i8**) diff --git a/src/test/codegen/abi-main-signature-32bit-c-int.rs b/src/test/codegen/abi-main-signature-32bit-c-int.rs new file mode 100644 index 00000000000..3139749dfcb --- /dev/null +++ b/src/test/codegen/abi-main-signature-32bit-c-int.rs @@ -0,0 +1,20 @@ +// Copyright 2017 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Checks the signature of the implicitly generated native main() +// entry point. It must match C's `int main(int, char **)`. + +// This test is for targets with 32bit c_int only. +// ignore-msp430 + +fn main() { +} + +// CHECK: define i32 @main(i32, i8**) diff --git a/src/test/codegen/abi-main-signature.rs b/src/test/codegen/abi-main-signature.rs deleted file mode 100644 index 3d09e0d9e6f..00000000000 --- a/src/test/codegen/abi-main-signature.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Checks the signature of the implicitly generated native main() -// entry point. It must match C's `int main(int, char **)`. - -fn main() { -} - -// CHECK: define i32 @main(i32, i8**) -- cgit 1.4.1-3-g733a5