Skip to content

Commit 55b3d49

Browse files
committed
Clean up tests
1 parent 684facf commit 55b3d49

File tree

6 files changed

+310
-203
lines changed

6 files changed

+310
-203
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -116,31 +116,37 @@ jobs:
116116

117117
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features
118118
env:
119+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
119120
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
120121
if: matrix.target == '' || startsWith(matrix.target, 'x86_64')
121122
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release
122123
env:
124+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
123125
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
124126
if: matrix.target == '' || startsWith(matrix.target, 'x86_64')
125127
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release
126128
env:
127129
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
128130
CARGO_PROFILE_RELEASE_LTO: fat
131+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
129132
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
130133
if: matrix.target == '' || startsWith(matrix.target, 'x86_64')
131134

132135
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features
133136
env:
137+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+lse
134138
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+lse
135139
if: startsWith(matrix.target, 'aarch64')
136140
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release
137141
env:
142+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+lse
138143
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+lse
139144
if: startsWith(matrix.target, 'aarch64')
140145
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release
141146
env:
142147
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
143148
CARGO_PROFILE_RELEASE_LTO: fat
149+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+lse
144150
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+lse
145151
if: startsWith(matrix.target, 'aarch64')
146152

@@ -285,30 +291,19 @@ jobs:
285291
CARGO_PROFILE_RELEASE_LTO: fat
286292
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features -Z doctest-xcompile
287293
env:
294+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
288295
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
289296
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -Z doctest-xcompile
290297
env:
298+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
291299
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
292300
- run: cargo test -vv --workspace --exclude asm-test --exclude bench --all-features --release -Z doctest-xcompile
293301
env:
294302
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
295303
CARGO_PROFILE_RELEASE_LTO: fat
304+
RUSTDOCFLAGS: ${{ env.RUSTDOCFLAGS }} -C target-feature=+cmpxchg16b
296305
RUSTFLAGS: ${{ env.RUSTFLAGS }} -C target-feature=+cmpxchg16b
297306

298-
cov:
299-
runs-on: ubuntu-latest
300-
steps:
301-
- uses: actions/checkout@v3
302-
with:
303-
persist-credentials: false
304-
- uses: taiki-e/github-actions/install-rust@main
305-
with:
306-
component: llvm-tools-preview
307-
- uses: taiki-e/install-action@cargo-llvm-cov
308-
- run: cargo llvm-cov --workspace --exclude asm-test --exclude bench --all-features
309-
- run: cargo llvm-cov --workspace --exclude asm-test --exclude bench --all-features --text --no-run --hide-instantiations
310-
- run: cargo llvm-cov --workspace --exclude asm-test --exclude bench --all-features --text --no-run
311-
312307
codegen:
313308
runs-on: ubuntu-latest
314309
permissions:
@@ -389,7 +384,6 @@ jobs:
389384
- miri
390385
- san
391386
- valgrind
392-
- cov
393387
- codegen
394388
- tidy
395389
- docs

src/imp/fallback/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ macro_rules! atomic {
167167
// However, according to atomic-memcpy's asm test, there seems
168168
// to be no tier 1 or tier 2 platform that generates such code
169169
// for a pointer-width relaxed load + acquire fence:
170-
// https://github.com/taiki-e/atomic-memcpy/tree/a8e78b99710b3b35ab123c1d3144cb618ae61a57/tests/asm-test/asm
170+
// https://github.com/taiki-e/atomic-memcpy/tree/v0.1.3/tests/asm-test/asm
171171
unsafe {
172172
self.v.get().read()
173173
}

src/lib.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,13 @@ On x86_64, when the `outline-atomics` optional feature is not enabled and `cmpxc
9595
#![cfg_attr(not(portable_atomic_no_unsafe_op_in_unsafe_fn), warn(unsafe_op_in_unsafe_fn))] // unsafe_op_in_unsafe_fn requires Rust 1.52
9696
#![cfg_attr(portable_atomic_no_unsafe_op_in_unsafe_fn, allow(unused_unsafe))]
9797
#![warn(
98+
clippy::default_union_representation,
9899
clippy::exhaustive_enums,
99100
clippy::exhaustive_structs,
100101
clippy::inline_asm_x86_att_syntax,
101102
clippy::missing_inline_in_public_items,
102103
clippy::pedantic,
104+
clippy::transmute_undefined_repr,
103105
clippy::undocumented_unsafe_blocks
104106
)]
105107
#![allow(
@@ -1378,16 +1380,18 @@ atomic instructions or locks will be used.
13781380
any(portable_atomic_target_feature_lse, target_feature = "lse"),
13791381
),
13801382
portable_atomic_armv5te,
1381-
all(target_arch = "mips", target_endian = "little"),
1382-
all(target_arch = "mips64", target_endian = "little"),
1383+
target_arch = "mips",
1384+
target_arch = "mips64",
13831385
target_arch = "powerpc",
13841386
target_arch = "powerpc64",
13851387
))]
13861388
{
13871389
// HACK: the following operations are currently broken (at least on qemu):
1388-
// - aarch64+lse's `AtomicI{8,16}::fetch_{max,min}` (release mode)
1390+
// - aarch64's `AtomicI{8,16}::fetch_{max,min}` (release mode + lse)
13891391
// - armv5te's `Atomic{I,U}{8,16}::fetch_{max,min}`
1392+
// - mips's `AtomicI8::fetch_{max,min}` (release mode)
13901393
// - mipsel's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)
1394+
// - mips64's `AtomicI8::fetch_{max,min}` (release mode)
13911395
// - mips64el's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)
13921396
// - powerpc's `AtomicI{8,16}::fetch_{max,min}`
13931397
// - powerpc64's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)
@@ -1445,16 +1449,18 @@ atomic instructions or locks will be used.
14451449
any(portable_atomic_target_feature_lse, target_feature = "lse"),
14461450
),
14471451
portable_atomic_armv5te,
1448-
all(target_arch = "mips", target_endian = "little"),
1449-
all(target_arch = "mips64", target_endian = "little"),
1452+
target_arch = "mips",
1453+
target_arch = "mips64",
14501454
target_arch = "powerpc",
14511455
target_arch = "powerpc64",
14521456
))]
14531457
{
14541458
// HACK: the following operations are currently broken (at least on qemu):
14551459
// - aarch64's `AtomicI{8,16}::fetch_{max,min}` (release mode + lse)
14561460
// - armv5te's `Atomic{I,U}{8,16}::fetch_{max,min}`
1461+
// - mips's `AtomicI8::fetch_{max,min}` (release mode)
14571462
// - mipsel's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)
1463+
// - mips64's `AtomicI8::fetch_{max,min}` (release mode)
14581464
// - mips64el's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)
14591465
// - powerpc's `AtomicI{8,16}::fetch_{max,min}`
14601466
// - powerpc64's `AtomicI{8,16}::fetch_{max,min}` (debug mode, at least)

0 commit comments

Comments
 (0)