summaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/winline-1.c13
-rw-r--r--gcc/testsuite/gcc.dg/winline-2.c8
-rw-r--r--gcc/testsuite/gcc.dg/winline-3.c21
-rw-r--r--gcc/testsuite/gcc.dg/winline-4.c11
-rw-r--r--gcc/testsuite/gcc.dg/winline-5.c29
-rw-r--r--gcc/testsuite/gcc.dg/winline-6.c21
-rw-r--r--gcc/testsuite/gcc.dg/winline-7.c12
8 files changed, 119 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 55b8f033e6b..0b82e5877c8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2004-01-04 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/winline[1-7].c: New tests.
+
2004-01-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/13520
diff --git a/gcc/testsuite/gcc.dg/winline-1.c b/gcc/testsuite/gcc.dg/winline-1.c
new file mode 100644
index 00000000000..ac2ae82427a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/winline-1.c
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2" } */
+
+void q(void);
+inline int t(void)
+{
+ int ret;
+ q();
+ ret = t(); /* We define sane semantics for inline keyword on recursive
+ functions, so do not warn here. */
+ q();
+ return ret;
+}
diff --git a/gcc/testsuite/gcc.dg/winline-2.c b/gcc/testsuite/gcc.dg/winline-2.c
new file mode 100644
index 00000000000..584c68fddf6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/winline-2.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2" } */
+
+inline int q(void); /* { dg-warning "body not available" "" } */
+inline int t(void)
+{
+ return q(); /* { dg-warning "called from here" "" } */
+}
diff --git a/gcc/testsuite/gcc.dg/winline-3.c b/gcc/testsuite/gcc.dg/winline-3.c
new file mode 100644
index 00000000000..ce9e08012ca
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/winline-3.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2 --param max-inline-insns-single=1" } */
+
+void big (void);
+inline int q(void)
+{ /* { dg-warning "max-inline-insns-single" "" } */
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+}
+inline int t (void)
+{
+ return q (); /* { dg-warning "called from here" "" } */
+}
diff --git a/gcc/testsuite/gcc.dg/winline-4.c b/gcc/testsuite/gcc.dg/winline-4.c
new file mode 100644
index 00000000000..5ce0a02202d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/winline-4.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O1 -fno-unit-at-a-time" } */
+
+inline int q(void); /* { dg-warning "body not available" } */
+inline int t(void)
+{
+ return q(); /* { dg-warning "called from here" } */
+}
+int q(void)
+{
+}
diff --git a/gcc/testsuite/gcc.dg/winline-5.c b/gcc/testsuite/gcc.dg/winline-5.c
new file mode 100644
index 00000000000..20df786a757
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/winline-5.c
@@ -0,0 +1,29 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2 --param inline-unit-growth=0" } */
+
+void big (void);
+inline int q(void)
+{ /* { dg-warning "inline-unit-growth" } */
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+}
+inline int q1(void)
+{
+ big();
+ big();
+ big();
+}
+int t (void)
+{
+ /* We allow one inlining over limit. */
+ q1();
+ return q (); /* { dg-warning "called from here" } */
+}
diff --git a/gcc/testsuite/gcc.dg/winline-6.c b/gcc/testsuite/gcc.dg/winline-6.c
new file mode 100644
index 00000000000..7ce7481a3ef
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/winline-6.c
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2 --param large-function-growth=0 --param large-function-insns=1" } */
+
+void big (void);
+inline int q(void)
+{ /* { dg-warning "large-function-growth" } */
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+ big();
+}
+inline int t (void)
+{
+ return q (); /* { dg-warning "called from here" } */
+}
diff --git a/gcc/testsuite/gcc.dg/winline-7.c b/gcc/testsuite/gcc.dg/winline-7.c
new file mode 100644
index 00000000000..03b951763dc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/winline-7.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-Winline -O2" } */
+
+void big (void);
+inline int q(void)
+{ /* { dg-warning "(function not inlinable|alloca)" } */
+ return (int)alloca(10);
+}
+inline int t (void)
+{
+ return q (); /* { dg-warning "called from here" } */
+}