Skip to content

Commit 46a68d1

Browse files
committed
added matching for unsupported clang targets
1 parent 8fbd055 commit 46a68d1

File tree

1 file changed

+18
-1
lines changed
  • tests/run-make/core-ffi-typecheck-clang

1 file changed

+18
-1
lines changed

tests/run-make/core-ffi-typecheck-clang/rmake.rs

+18-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ const SKIPPED_TARGETS: &[&str] = &[
2121
"csky-unknown-linux-gnuabiv2hf",
2222
];
2323

24+
const MAPPED_TARGETS: &[(&str, &str)] = &[
25+
("armv5te-unknown-linux-uclibcgnueabi", "armv5te-unknown-linux"),
26+
("mips-unknown-linux-uclibc", "mips-unknown-linux"),
27+
("mipsel-unknown-linux-uclibc", "mips-unknown-linux"),
28+
("powerpc-unknown-linux-gnuspe", "powerpc-unknown-linux-gnu"),
29+
("powerpc-unknown-linux-muslspe", "powerpc-unknown-linux-musl"),
30+
("x86_64-unknown-l4re-uclibc", "x86_64-unknown-l4re"),
31+
];
32+
2433
fn main() {
2534
let minicore_path = run_make_support::source_root().join("tests/auxiliary/minicore.rs");
2635

@@ -39,9 +48,17 @@ fn main() {
3948
continue;
4049
}
4150

51+
// Create a new variable to hold either the mapped target or original llvm_target
52+
let target_to_use = MAPPED_TARGETS
53+
.iter()
54+
.find(|&&(from, _)| from == *llvm_target)
55+
.map(|&(_, to)| to)
56+
.unwrap_or(llvm_target);
57+
58+
4259
// Run Clang's preprocessor for the relevant target, printing default macro definitions.
4360
let clang_output =
44-
clang().args(&["-E", "-dM", "-x", "c", "/dev/null", "-target", &llvm_target]).run();
61+
clang().args(&["-E", "-dM", "-x", "c", "/dev/null", "-target", &target_to_use]).run();
4562

4663
let defines = String::from_utf8(clang_output.stdout()).expect("Invalid UTF-8");
4764

0 commit comments

Comments
 (0)