mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-01 10:56:09 -06:00
28 lines
326 B
C++
Generated
28 lines
326 B
C++
Generated
#include <type_traits>
|
|
#include <thread>
|
|
|
|
struct safetls
|
|
{
|
|
int val;
|
|
int x;
|
|
int y;
|
|
int value() {return val - x + y;}
|
|
};
|
|
|
|
thread_local safetls g{0x98765};
|
|
thread_local int h = 0x12345;
|
|
|
|
inline int func()
|
|
{
|
|
return g.value();
|
|
}
|
|
|
|
inline int func2()
|
|
{
|
|
return h;
|
|
}
|
|
|
|
int main()
|
|
{
|
|
return func() + func2();
|
|
} |