Enhance gcc test for visible variables with -fwhole-program.
authorKevin O'Connor <kevin@koconnor.net>
Fri, 26 Jun 2009 22:55:50 +0000 (18:55 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Fri, 26 Jun 2009 22:55:50 +0000 (18:55 -0400)
Add 'extern' decl before variable test - some older compilers wont
    mark a variable visible if an extern decl precedes it.

tools/test-gcc.sh

index 5f55f37d840feeab991d822ef43387da011318cf..738cf64051ac1b7f055b06144513b5f8f9c99c2d 100755 (executable)
@@ -19,6 +19,7 @@ fi
 # Test if "visible" variables and functions are marked global.
 cat - > $TMPFILE1 <<EOF
 void __attribute__((externally_visible)) t1() { }
+extern unsigned char v1;
 unsigned char v1 __attribute__((section(".data16.foo.19"))) __attribute__((externally_visible));
 EOF
 $CC -Os -c -fwhole-program $TMPFILE1 -o $TMPFILE1o > /dev/null 2>&1