]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.opt/inline-break.c
Change inline frame breakpoint skipping logic (fix gdb.gdb/selftest.exp)
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.opt / inline-break.c
index 922102debb696791f53e32d11c4a3e2d8ef5082b..f64a81af93904452a73537691c9ef75b50b406c6 100644 (file)
@@ -176,6 +176,38 @@ not_inline_func3 (int x)
   return y + inline_func3 (x);
 }
 
+/* The following three functions serve to exercise GDB's inline frame
+   skipping logic when setting a user breakpoint on an inline function
+   by name.  */
+
+/* A static inlined function that is called by another static inlined
+   function.  */
+
+static inline ATTR int
+func_inline_callee (int x)
+{
+  return x * 23;
+}
+
+/* A static inlined function that calls another static inlined
+   function.  The body of the function is as simple as possible so
+   that both functions are inlined to the same PC address.  */
+
+static inline ATTR int
+func_inline_caller (int x)
+{
+  return func_inline_callee (x);
+}
+
+/* An extern not-inline function that calls a static inlined
+   function.  */
+
+int
+func_extern_caller (int x)
+{
+  return func_inline_caller (x);
+}
+
 /* Entry point.  */
 
 int
@@ -205,5 +237,7 @@ main (int argc, char *argv[])
 
   x = not_inline_func3 (-21);
 
+  func_extern_caller (1);
+
   return x;
 }