Skip to content

Adjustments to compiletest for CHERIoT #59

@xdoardo

Description

@xdoardo

Currently the needs-target-std compiletest directive does not work for riscv32cheriot-unknown-cheriotrtos, in the sense that tests with that directive aren't ignored.

As pointed out on a related thread on Zulip, the reason should be this function not fitting the scheme of the CHERIoT target.

This directive is necessary to make ./x test tests/codegen-llvm --target=riscv32cheriot-unknown-cheriotrtos one step closer to working how it should, that is, not complaining about std not being found for CHERIoT. The same can of course be said of other sets of tests that could today work on CHERIoT (i.e. those that do not require running the tests on the target) such as assembly-llvm.
As a bonus, it also removes the need for no-std = true in the bootstrap file.

To this end we should:

  1. Patch the function linked above to return false when targeting CHERIoT;
  2. add only-riscv32cheriot-unknown-cheriotrtos directive to compiletest so that ./x test does not fail when running a CHERIoT-specific test when the target is not CHERIoT; and
  3. add needs-target-std directives to all the tests in codegen-llvm that use std so that they are ignored when running tests for CHERIoT.

The last point is debatable and only partially correct: all the tests that don't have a #![no_std] annotation now might actually use only items that can be found either in core or alloc.

Edit: Another important directive to investigate is only-64bits. It currently matches CHERIoT on account that for this target it is target.pointer_width = 64. Adding a ignore-riscv32cheriot-unknown-cheriotrtos directive can help mitigate issues related to that directive while we figure out a better solution (for example not relying on the ambiguous pointer_width value).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions