(func1): Use it.
(func2): Likewise.
(func3): Likewise.
(outer_inline1): Likewise.
(outer_inline2): Likewise.
* gdb.opt/inline-bt.c (ATTR): New define.
(func1): Use it.
(func2): Likewise.
* gdb.opt/inline-locals.c (ATTR): New define.
(func1): Use it.
(func2): Likewise.
+2010-07-27 Tom Tromey <tromey@redhat.com>
+
+ * gdb.opt/inline-cmds.c (ATTR): New define.
+ (func1): Use it.
+ (func2): Likewise.
+ (func3): Likewise.
+ (outer_inline1): Likewise.
+ (outer_inline2): Likewise.
+ * gdb.opt/inline-bt.c (ATTR): New define.
+ (func1): Use it.
+ (func2): Likewise.
+ * gdb.opt/inline-locals.c (ATTR): New define.
+ (func1): Use it.
+ (func2): Likewise.
+
2010-07-27 Tom Tromey <tromey@redhat.com>
* gdb.stabs/gdb11479.c (hack): New function.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This is only ever run if it is compiled with a new-enough GCC, but
+ we don't want the compilation to fail if compiled by some other
+ compiler. */
+#ifdef __GNUC__
+#define ATTR __attribute__((always_inline))
+#else
+#define ATTR
+#endif
+
int x, y;
volatile int result;
void bar(void);
-inline int func1(void)
+inline ATTR int func1(void)
{
bar ();
return x * y;
}
-inline int func2(void)
+inline ATTR int func2(void)
{
return x * func1 ();
}
set binfile ${objdir}/${subdir}/${testfile}
if { [gdb_compile ${sources} ${binfile} \
- executable {debug optimize=-O2}] != "" } {
+ executable {debug optimize=-O2 additional_flags=-Winline}] != "" } {
untested inline-bt.exp
return -1
}
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This is only ever run if it is compiled with a new-enough GCC, but
+ we don't want the compilation to fail if compiled by some other
+ compiler. */
+#ifdef __GNUC__
+#define ATTR __attribute__((always_inline))
+#else
+#define ATTR
+#endif
+
int x, y;
volatile int result;
void marker(void);
void noinline(void);
-inline int func1(void)
+inline ATTR int func1(void)
{
bar ();
return x * y;
}
-inline int func2(void)
+inline ATTR int func2(void)
{
return x * func1 ();
}
-inline void func3(void)
+inline ATTR void func3(void)
{
bar ();
}
-inline void outer_inline1(void)
+inline ATTR void outer_inline1(void)
{
noinline ();
}
-inline void outer_inline2(void)
+inline ATTR void outer_inline2(void)
{
outer_inline1 ();
}
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+/* This is only ever run if it is compiled with a new-enough GCC, but
+ we don't want the compilation to fail if compiled by some other
+ compiler. */
+#ifdef __GNUC__
+#define ATTR __attribute__((always_inline))
+#else
+#define ATTR
+#endif
+
int x, y;
volatile int result;
volatile int *array_p;
void bar(void);
-inline int func1(int arg1)
+inline ATTR int func1(int arg1)
{
int array[64];
array_p = array;
return x * y + array_p[0] * arg1;
}
-inline int func2(int arg2)
+inline ATTR int func2(int arg2)
{
return x * func1 (arg2);
}