summaryrefslogtreecommitdiffstats
path: root/kdbg/testprogs/locals.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdbg/testprogs/locals.cpp')
-rw-r--r--kdbg/testprogs/locals.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/kdbg/testprogs/locals.cpp b/kdbg/testprogs/locals.cpp
new file mode 100644
index 0000000..ed2cf1e
--- /dev/null
+++ b/kdbg/testprogs/locals.cpp
@@ -0,0 +1,26 @@
+#include <stdio.h>
+
+
+// a function that has args but no locals
+
+static int nolocals(int argc, char** argv)
+{
+ printf("argc=%d, argv[0]=%s\n", argc, argv[0]);
+}
+
+
+// a function that has no args but locals
+
+static int noargs()
+{
+ int c = 1;
+ char* pgm[] = { "foo", 0 };
+ nolocals(c, pgm);
+}
+
+
+int main(int argc, char** argv)
+{
+ noargs();
+ nolocals(argc, argv);
+}