#!/bin/bash set -e cd $(dirname $0) echo -n "Testing $(basename -s .sh $0) ... " t=$(pwd)/tmp/$(basename -s .sh $0) mkdir -p $t 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() { foo = 3; bar = 5; printf("%d %d %d %d\n", *get_foo_addr(), *get_bar_addr(), foo, bar); return 0; } EOF cat <