#!/bin/bash set -e cd $(dirname $0) echo -n "Testing $(basename -s .sh $0) ... " t=$(pwd)/tmp/$(basename -s .sh $0) mkdir -p $t echo 'int main() {}' | cc -m32 -o $t/exe -xc - >& /dev/null \ || { echo skipped; exit; } cat < static _Thread_local int x1 = 1; static _Thread_local int x2; extern _Thread_local int x3; extern _Thread_local int x4; int get_x5(); int get_x6(); int main() { x2 = 2; printf("%d %d %d %d %d %d\n", x1, x2, x3, x4, get_x5(), get_x6()); return 0; } EOF cat <