]> git.proxmox.com Git - rustc.git/blob - tests/run-make/issue-69368/c.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / tests / run-make / issue-69368 / c.rs
1 #![crate_type = "bin"]
2 #![feature(start)]
3 #![no_std]
4
5 extern crate alloc;
6 extern crate a;
7 extern crate b;
8
9 use alloc::vec::Vec;
10 use core::alloc::*;
11
12 struct Allocator;
13
14 unsafe impl GlobalAlloc for Allocator {
15 unsafe fn alloc(&self, _: Layout) -> *mut u8 {
16 loop {}
17 }
18
19 unsafe fn dealloc(&self, _: *mut u8, _: Layout) {
20 loop {}
21 }
22 }
23
24 #[global_allocator]
25 static ALLOCATOR: Allocator = Allocator;
26
27 #[start]
28 fn main(argc: isize, _argv: *const *const u8) -> isize {
29 let mut v = Vec::new();
30 for i in 0..argc {
31 v.push(i);
32 }
33 v.iter().sum()
34 }