Skip to content

Commit

Permalink
mark C tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gankra committed Jun 30, 2024
1 parent 4ae1e21 commit 3285bb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub enum BuildError {
std::str::from_utf8(&.0.stdout).unwrap(),
std::str::from_utf8(&.0.stderr).unwrap())]
RustCompile(std::process::Output),
#[error("c compile errror\n{0}")]
#[error("c compile error\n{0}")]
CCompile(#[from] cc::Error),
}

Expand Down
19 changes: 5 additions & 14 deletions src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::TestId;
use crate::WriteBuffer;

/// These are the builtin test-expectations, edit these if there are new rules!
#[allow(unused_variables)]
pub fn get_test_rules(test: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl) -> TestRules {
use TestCheckMode::*;
use TestRunMode::*;
Expand All @@ -26,28 +27,18 @@ pub fn get_test_rules(test: &TestKey, caller: &dyn AbiImpl, callee: &dyn AbiImpl
let is_rust = caller.lang() == "rust" || callee.lang() == "rust";
let is_rust_and_c = is_c && is_rust;

// llvm and gcc disagree on the u128 ABI everywhere but aarch64 (arm64) and s390x.
// This is Bad! Ideally we should check for all clang<->gcc pairs but to start
// let's mark rust <-> C as disagreeing (because rust also disagrees with clang).
if !cfg!(any(target_arch = "aarch64", target_arch = "s390x"))
&& test.test == "ui128"
&& is_rust_and_c
{
result.check = Busted(Check);
}

// i128 types are fake on windows so this is all random garbage that might
// not even compile, but that datapoint is a little interesting/useful
// so let's keep running them and just ignore the result for now.
//
// Anyone who cares about this situation more can make the expectations more precise.
if cfg!(windows) && test.test == "ui128" {
if cfg!(windows) && (test.test == "i128" || test.test == "u128") {
result.check = Random;
}

// This test is just for investigation right now, nothing normative
if test.test == "sysv_i128_emulation" {
result.check = Random;
// FIXME: investigate why this is failing to build
if cfg!(windows) && is_c && (test.test == "EmptyStruct" || test.test == "EmptyStructInside") {
result.check = Busted(Build);
}

//
Expand Down

0 comments on commit 3285bb3

Please sign in to comment.