aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tls
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2009-02-05 01:18:02 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2009-02-05 01:18:02 +0000
commit5006381cc14df7bfb634b249f50b1bf30f39f841 (patch)
tree56e68154a7b8fc728b201d3220d4c952afea9169 /gcc/testsuite/gcc.dg/tls
parentb0789219a39008bf034a14d6da94cdc03c2f3d38 (diff)
downloadgcc-5006381cc14df7bfb634b249f50b1bf30f39f841.zip
gcc-5006381cc14df7bfb634b249f50b1bf30f39f841.tar.gz
gcc-5006381cc14df7bfb634b249f50b1bf30f39f841.tar.bz2
re PR c/35435 (ICE with attribute tls_model in typedef)
PR c/35435 * c-common.c (handle_tls_model_attribute): Ignore attribute for non-VAR_DECLs without checking DECL_THREAD_LOCAL_P. testsuite: * gcc.dg/tls/diag-6.c: New test. From-SVN: r143948
Diffstat (limited to 'gcc/testsuite/gcc.dg/tls')
-rw-r--r--gcc/testsuite/gcc.dg/tls/diag-6.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tls/diag-6.c b/gcc/testsuite/gcc.dg/tls/diag-6.c
new file mode 100644
index 0000000..71b0b95
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/diag-6.c
@@ -0,0 +1,8 @@
+/* Invalid tls_model attributes. PR 35435. */
+/* { dg-require-effective-target tls } */
+
+int v __attribute__((tls_model("initial-exec"))); /* { dg-warning "attribute ignored" } */
+typedef int X __attribute__((tls_model("initial-exec"))); /* { dg-warning "attribute ignored" } */
+void f(int x __attribute__((tls_model("initial-exec")))); /* { dg-warning "attribute ignored" } */
+__thread int a __attribute__((tls_model(1))); /* { dg-error "tls_model argument not a string" } */
+__thread int b __attribute__((tls_model("unknown"))); /* { dg-error "tls_model argument must be one of" } */