mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-10-31 17:04:42 +00:00
6d8ca42734
This does not really do anything, because ORCA/C does not support multithreading, but the C11 and later standards indicate it should be allowed anyway.
30 lines
579 B
C
30 lines
579 B
C
/*
|
|
* Test _Thread_local (C11).
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
|
|
extern _Thread_local int i;
|
|
char static _Thread_local c = 5;
|
|
_Thread_local struct {int x,y,z;} s = {3,6,8};
|
|
|
|
int main(void) {
|
|
_Thread_local int extern j;
|
|
static _Thread_local long d = 4567;
|
|
|
|
d = 123;
|
|
i = 14;
|
|
|
|
if (i+j+c+d+s.x+s.y+s.z != 171)
|
|
goto Fail;
|
|
|
|
printf ("Passed Conformance Test c11thrdlcl\n");
|
|
return 0;
|
|
|
|
Fail:
|
|
printf ("Failed Conformance Test c11thrdlcl\n");
|
|
}
|
|
|
|
int _Thread_local i = 9999;
|
|
_Thread_local int j = 12;
|