view gcc/testsuite/g++.dg/tls/init-1.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* Valid initializations.  */
/* { dg-require-effective-target tls } */

__thread int i = 42;

static int j;
__thread int *p = &j;

/* Note that this is valid in C++ (unlike C) as a run-time initialization.  */
int *q = &i;

/* Valid because "const int k" is an integral constant expression in C++.  */
__thread const int k = 42;
__thread const int l = k;