Skip to content

Instantly share code, notes, and snippets.

@taiki-e
Last active Feb 13, 2022
Embed
What would you like to do?
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0 OR MIT
set -euo pipefail
IFS=$'\n\t'
cd "$(dirname "$0")"/..
for target in $(rustc --print target-list); do
cfgs=$(rustc --print cfg --target "${target}")
if ! grep <<<"${cfgs}" -q "target_has_atomic=\"64\""; then
# target doesn't has `Atomic{i,U}64`
continue
fi
if grep <<<"${cfgs}" -q "target_has_atomic_equal_alignment=\"64\""; then
# `Atomic{i,U}64` and `{i,u}64` has the same alignment
continue
fi
if rustup target list | grep -Eq "^${target}( |$)"; then
echo "${target}"
else
echo "${target} (tier 3)"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment