]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* gcc.dg/debug/tls-1.c: New test.
authorJakub Jelinek <jakub@redhat.com>
Wed, 16 Dec 2009 09:16:44 +0000 (10:16 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 16 Dec 2009 09:16:44 +0000 (10:16 +0100)
From-SVN: r155286

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/debug/tls-1.c [new file with mode: 0644]

index 1549424166859469293e1833bc7b069f1975ef47..7f650de840dc928514b61b4470967a02f3518400 100644 (file)
@@ -1,3 +1,7 @@
+2009-12-16  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.dg/debug/tls-1.c: New test.
+
 2009-12-15  Jason Merrill  <jason@redhat.com>
 
        PR c++/42358
diff --git a/gcc/testsuite/gcc.dg/debug/tls-1.c b/gcc/testsuite/gcc.dg/debug/tls-1.c
new file mode 100644 (file)
index 0000000..a9431ef
--- /dev/null
@@ -0,0 +1,19 @@
+/* Test that optimized out __thread var doesn't have its location
+   referenced in debug info.  */
+/* { dg-do link } */
+/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls } */
+
+static __thread int vara;
+
+int
+foo (int b)
+{
+  return vara + b;
+}
+
+int
+main (void)
+{
+  return foo (0);
+}