summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/const_value.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.base/const_value.c')
-rw-r--r--testsuite/systemtap.base/const_value.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/const_value.c b/testsuite/systemtap.base/const_value.c
new file mode 100644
index 00000000..2ed0f5c4
--- /dev/null
+++ b/testsuite/systemtap.base/const_value.c
@@ -0,0 +1,29 @@
+#include "sdt.h"
+
+struct foo
+{
+ const int i;
+ const long j;
+};
+
+typedef struct foo fooer;
+
+static int
+bar (const int i, const long j)
+{
+ return i * j;
+}
+
+static int
+func (int (*f) ())
+{
+ const fooer baz = { .i = 2, .j = 21 };
+ STAP_PROBE (test, constvalues);
+ return f(baz.i, baz.j);
+}
+
+int
+main (int argc, char *argv[], char *envp[])
+{
+ return func (&bar) - 42;
+}