]> git.proxmox.com Git - rustc.git/blame - src/test/run-make/wasm-symbols-not-exported/bar.rs
Update unsuspicious file list
[rustc.git] / src / test / run-make / wasm-symbols-not-exported / bar.rs
CommitLineData
b7449926
XL
1#![feature(panic_handler, alloc_error_handler)]
2#![crate_type = "cdylib"]
8faf50e0 3#![no_std]
2c00a5a8 4
b7449926
XL
5use core::alloc::*;
6
7struct B;
8
9unsafe impl GlobalAlloc for B {
10 unsafe fn alloc(&self, x: Layout) -> *mut u8 {
11 1 as *mut u8
12 }
13
14 unsafe fn dealloc(&self, ptr: *mut u8, x: Layout) {
15 }
16}
17
18#[global_allocator]
19static A: B = B;
20
21#[no_mangle]
22pub extern fn foo(a: u32) -> u32 {
23 assert_eq!(a, 3);
24 a * 2
25}
3157f602 26
8faf50e0 27#[alloc_error_handler]
b7449926 28fn a(_: core::alloc::Layout) -> ! {
8faf50e0 29 loop {}
a7813a04
XL
30}
31
b7449926
XL
32#[panic_handler]
33fn b(_: &core::panic::PanicInfo) -> ! {
34 loop {}
35}