lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /* This is for tst-tlsalign-extern.c, which see. It's essential for the |
| 2 | purpose of the test that these definitions be in a separate translation |
| 3 | unit from the code using the variables. */ |
| 4 | |
| 5 | __thread int tdata1 = 1; |
| 6 | __thread int tdata2 __attribute__ ((aligned (0x10))) = 2; |
| 7 | __thread int tdata3 __attribute__ ((aligned (0x1000))) = 4; |
| 8 | __thread int tbss1; |
| 9 | __thread int tbss2 __attribute__ ((aligned (0x10))); |
| 10 | __thread int tbss3 __attribute__ ((aligned (0x1000))); |
| 11 | |
| 12 | /* This function is never called. But its presence in this translation |
| 13 | unit makes GCC emit the variables above in the order defined (perhaps |
| 14 | because it's the order in which they're used here?) rather than |
| 15 | reordering them into descending order of alignment requirement--and so |
| 16 | keeps it more similar to the tst-tlsalign-static.c case--just in case |
| 17 | that affects the bug (though there is no evidence that it does). */ |
| 18 | |
| 19 | void |
| 20 | unused (void) |
| 21 | { |
| 22 | tdata1 = -1; |
| 23 | tdata2 = -2; |
| 24 | tdata3 = -3; |
| 25 | tbss1 = -4; |
| 26 | tbss2 = -5; |
| 27 | tbss3 = -6; |
| 28 | } |