#!/bin/bash set -e cd $(dirname $0) mold=`pwd`/../mold echo -n "Testing $(basename -s .sh $0) ... " t=$(pwd)/tmp/$(basename -s .sh $0) mkdir -p $t if [ $(uname -m) = x86_64 ]; then dialect=gnu elif [ $(uname -m) = aarch64 ]; then dialect=trad else echo skipped exit 0 fi cat < extern _Thread_local int foo; static _Thread_local int bar; int *get_foo_addr() { return &foo; } int *get_bar_addr() { return &bar; } int main() { bar = 5; printf("%d %d %d %d\n", *get_foo_addr(), *get_bar_addr(), foo, bar); return 0; } EOF cat <