]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_codegen_gcc/tests/run/exit.rs
New upstream version 1.57.0+dfsg1
[rustc.git] / compiler / rustc_codegen_gcc / tests / run / exit.rs
CommitLineData
c295e0f8
XL
1// Compiler:
2//
3// Run-time:
4// status: 2
5
6#![feature(auto_traits, lang_items, no_core, start, intrinsics)]
7
8#![no_std]
9#![no_core]
10
11mod libc {
12 #[link(name = "c")]
13 extern "C" {
14 pub fn exit(status: i32);
15 }
16}
17
18/*
19 * Core
20 */
21
22// Because we don't have core yet.
23#[lang = "sized"]
24pub trait Sized {}
25
26#[lang = "copy"]
27trait Copy {
28}
29
30impl Copy for isize {}
31
32#[lang = "receiver"]
33trait Receiver {
34}
35
36#[lang = "freeze"]
37pub(crate) unsafe auto trait Freeze {}
38
39/*
40 * Code
41 */
42
43#[start]
44fn main(mut argc: isize, _argv: *const *const u8) -> isize {
45 unsafe {
46 libc::exit(2);
47 }
48 0
49}