2012-06-23 13:16:37 +00:00
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -verify -fsyntax-only %s
2012-06-23 11:51:46 +00:00
# if !__has_attribute(tls_model)
# error "Should support tls_model attribute"
# endif
2022-02-03 16:39:21 -05:00
int f ( void ) __attribute ( ( tls_model ( " global-dynamic " ) ) ) ; // expected-error {{'tls_model' attribute only applies to thread-local variables}}
2012-06-23 11:51:46 +00:00
int x __attribute ( ( tls_model ( " global-dynamic " ) ) ) ; // expected-error {{'tls_model' attribute only applies to thread-local variables}}
static __thread int y __attribute ( ( tls_model ( " global-dynamic " ) ) ) ; // no-warning
2013-07-23 19:30:11 +00:00
static __thread int y __attribute ( ( tls_model ( " local " , " dynamic " ) ) ) ; // expected-error {{'tls_model' attribute takes one argument}}
2021-07-10 15:52:54 +02:00
static __thread int y __attribute ( ( tls_model ( 123 ) ) ) ; // expected-error {{expected string literal as argument of 'tls_model' attribute}}
2012-06-23 11:51:46 +00:00
static __thread int y __attribute ( ( tls_model ( " foobar " ) ) ) ; // expected-error {{tls_model must be "global-dynamic", "local-dynamic", "initial-exec" or "local-exec"}}