File tree 2 files changed +57
-0
lines changed
src/test/run-make/fmt-write-bloat
2 files changed +57
-0
lines changed Original file line number Diff line number Diff line change
1
+ -include ../../run-make-fulldeps/tools.mk
2
+
3
+ # ignore-windows
4
+
5
+ ifeq ($(shell $(RUSTC ) -vV | grep 'host : $(TARGET ) '),)
6
+
7
+ # Don't run this test when cross compiling.
8
+ all :
9
+
10
+ else
11
+
12
+ NM = nm
13
+
14
+ PANIC_SYMS = panic_bounds_check pad_integral Display Debug
15
+
16
+ # Allow for debug_assert!() in debug builds of std.
17
+ ifdef NO_DEBUG_ASSERTIONS
18
+ PANIC_SYMS += panicking panic_fmt
19
+ endif
20
+
21
+ all : main.rs
22
+ $(RUSTC ) $< -O
23
+ $(NM ) $(call RUN_BINFILE,main) | $(CGREP ) -v $(PANIC_SYMS )
24
+
25
+ endif
Original file line number Diff line number Diff line change
1
+ #![ feature( lang_items) ]
2
+ #![ feature( start) ]
3
+ #![ no_std]
4
+
5
+ use core:: fmt;
6
+ use core:: fmt:: Write ;
7
+
8
+ #[ link( name = "c" ) ]
9
+ extern "C" { }
10
+
11
+ struct Dummy ;
12
+
13
+ impl fmt:: Write for Dummy {
14
+ #[ inline( never) ]
15
+ fn write_str ( & mut self , _: & str ) -> fmt:: Result {
16
+ Ok ( ( ) )
17
+ }
18
+ }
19
+
20
+ #[ start]
21
+ fn main ( _: isize , _: * const * const u8 ) -> isize {
22
+ let _ = writeln ! ( Dummy , "Hello World" ) ;
23
+ 0
24
+ }
25
+
26
+ #[ lang = "eh_personality" ]
27
+ fn eh_personality ( ) { }
28
+
29
+ #[ panic_handler]
30
+ fn panic ( _: & core:: panic:: PanicInfo ) -> ! {
31
+ loop { }
32
+ }
You can’t perform that action at this time.
0 commit comments