| 
6 | 6 | ui/codegen/assembly test suites. It provides `core` stubs for tests that need to  | 
7 | 7 | build for cross-compiled targets but do not need/want to run.  | 
8 | 8 | 
 
  | 
 | 9 | +<div class="warning">  | 
 | 10 | +Please note that [`minicore`] is only intended for `core` items, and explicitly  | 
 | 11 | +**not** `std` or `alloc` items because `core` items are applicable to a wider  | 
 | 12 | +range of tests.  | 
 | 13 | +</div>  | 
 | 14 | + | 
9 | 15 | A test can use [`minicore`] by specifying the `//@ add-core-stubs` directive.  | 
10 | 16 | Then, mark the test with `#![feature(no_core)]` + `#![no_std]` + `#![no_core]`.  | 
11 | 17 | Due to Edition 2015 extern prelude rules, you will probably need to declare  | 
12 | 18 | `minicore` as an extern crate.  | 
13 | 19 | 
 
  | 
 | 20 | +## Implied compiler flags  | 
 | 21 | + | 
14 | 22 | Due to the `no_std` + `no_core` nature of these tests, `//@ add-core-stubs`  | 
15 | 23 | implies and requires that the test will be built with `-C panic=abort`.  | 
16 |  | -Unwinding panics are not supported.  | 
 | 24 | +**Unwinding panics are not supported.**  | 
 | 25 | + | 
 | 26 | +Tests will also be built with `-C force-unwind-tables=yes` to preserve CFI  | 
 | 27 | +directives in assembly tests.  | 
 | 28 | + | 
 | 29 | +TL;DR: `//@ add-core-stubs` implies two compiler flags:  | 
 | 30 | + | 
 | 31 | +1. `-C panic=abort`  | 
 | 32 | +2. `-C force-unwind-tables=yes`  | 
 | 33 | + | 
 | 34 | +## Adding more `core` stubs  | 
17 | 35 | 
 
  | 
18 | 36 | If you find a `core` item to be missing from the [`minicore`] stub, consider  | 
19 | 37 | adding it to the test auxiliary if it's likely to be used or is already needed  | 
20 | 38 | by more than one test.  | 
21 | 39 | 
 
  | 
22 |  | -<div class="warning">  | 
23 |  | -Please note that [`minicore`] is only intended for `core` items, and explicitly  | 
24 |  | -**not** `std` or `alloc` items because `core` items are applicable to a wider  | 
25 |  | -range of tests.  | 
26 |  | -</div>  | 
27 |  | - | 
28 | 40 | ## Example codegen test that uses `minicore`  | 
29 | 41 | 
 
  | 
30 | 42 | ```rust,no_run  | 
 | 
0 commit comments