Skip to content

Commit 0a54f24

Browse files
authored
Merge pull request #225 from rust-lang/feature/stdarch-tests
Run stdarch tests in the CI
2 parents 8520bc7 + 054696e commit 0a54f24

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

.github/workflows/release.yml

+5
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,8 @@ jobs:
105105
- name: Run tests
106106
run: |
107107
./test.sh --release --clean --release-sysroot --build-sysroot --mini-tests --std-tests # --test-libcore # FIXME(antoyo): libcore tests fail.
108+
109+
- name: Run stdarch tests
110+
run: |
111+
cd build_sysroot/sysroot_src/library/stdarch/
112+
CHANNEL=release TARGET=x86_64-unknown-linux-gnu ../../../../cargo.sh test

patches/0001-Disable-examples.patch

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From a2d53a324a02c04b76c0e9d39dc15cd443a3b8b2 Mon Sep 17 00:00:00 2001
2+
From: Antoni Boucher <[email protected]>
3+
Date: Fri, 25 Nov 2022 11:18:11 -0500
4+
Subject: [PATCH] Disable examples
5+
6+
---
7+
library/stdarch/Cargo.toml | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/library/stdarch/Cargo.toml b/library/stdarch/Cargo.toml
11+
index fbe0a95..748d72d 100644
12+
--- a/library/stdarch/Cargo.toml
13+
+++ b/library/stdarch/Cargo.toml
14+
@@ -3,7 +3,7 @@ members = [
15+
"crates/core_arch",
16+
"crates/std_detect",
17+
"crates/stdarch-gen",
18+
- "examples/"
19+
+ #"examples/"
20+
]
21+
exclude = [
22+
"crates/wasm-assert-instr-tests"
23+
--
24+
2.26.2.7.g19db9cfb68.dirty
25+

src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub fn compile_codegen_unit<'tcx>(tcx: TyCtxt<'tcx>, cgu_name: Symbol, supports_
101101
context.add_command_line_option("-m64");
102102
context.add_command_line_option("-mbmi");
103103
context.add_command_line_option("-mgfni");
104-
context.add_command_line_option("-mavxvnni");
104+
//context.add_command_line_option("-mavxvnni"); // The CI doesn't support this option.
105105
context.add_command_line_option("-mf16c");
106106
context.add_command_line_option("-maes");
107107
context.add_command_line_option("-mxsavec");

src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ pub fn target_features(sess: &Session, allow_unstable: bool) -> Vec<Symbol> {
316316
// gcc -march=native -Q --help=target
317317
#[cfg(feature="master")]
318318
{
319-
(_feature.contains("sse") || _feature.contains("avx")) && !_feature.contains("avx512")
319+
// NOTE: the CPU in the CI doesn't support sse4a, so disable it to make the stdarch tests pass in the CI.
320+
(_feature.contains("sse") || _feature.contains("avx")) && !_feature.contains("avx512") && !_feature.contains("sse4a")
320321
}
321322
#[cfg(not(feature="master"))]
322323
{

0 commit comments

Comments
 (0)