]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Wed, 15 Dec 2004 19:17:57 +0000 (19:17 +0000)
committerNo Author <no-author@gcc.gnu.org>
Wed, 15 Dec 2004 19:17:57 +0000 (19:17 +0000)
'gcc-3_4-branch'.

From-SVN: r92212

gcc/testsuite/g++.dg/opt/inline9.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/opt/inline9.C b/gcc/testsuite/g++.dg/opt/inline9.C
new file mode 100644 (file)
index 0000000..10ccb47
--- /dev/null
@@ -0,0 +1,29 @@
+// PR c++/17972
+// Origin: Michal Ostrowski <mostrows@watson.ibm.com>
+// Testcase by Alan Modra <amodra@bigpond.net.au>
+// { dg-do run }
+// { dg-options "-O" }
+// { dg-options "-O -mtune=i686" { target i?86-*-* } }
+
+struct thread_info
+{
+  short preempt_count;
+} x;
+
+static inline struct thread_info *cti (void) __attribute__ ((const));
+static inline struct thread_info *cti (void)
+{
+  return &x;
+}
+
+void fn (void) __attribute__ ((noinline));
+void fn (void)
+{
+  ++cti()->preempt_count;
+}
+
+int main (void)
+{
+  fn ();
+  return 0;
+}