brintos

brintos / llvm-project-archived public Read only

0
0
Text · 942 B · ec99c7a Raw
15 lines · c
1// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -verify -fsyntax-only %s2 3#if !__has_attribute(tls_model)4#error "Should support tls_model attribute"5#endif6 7int f(void) __attribute((tls_model("global-dynamic"))); // expected-error {{'tls_model' attribute only applies to thread-local variables}}8 9int x __attribute((tls_model("global-dynamic"))); // expected-error {{'tls_model' attribute only applies to thread-local variables}}10static __thread int y __attribute((tls_model("global-dynamic"))); // no-warning11 12static __thread int y __attribute((tls_model("local", "dynamic"))); // expected-error {{'tls_model' attribute takes one argument}}13static __thread int y __attribute((tls_model(123))); // expected-error {{expected string literal as argument of 'tls_model' attribute}}14static __thread int y __attribute((tls_model("foobar"))); // expected-error {{tls_model must be "global-dynamic", "local-dynamic", "initial-exec" or "local-exec"}}15