--- /dev/null
+#! stap -gp4
+
+# test accessing locals using STAP_ARG_* macros
+function baz:long(foo:long, bar:string)
+%{
+ printk("%s\n", STAP_ARG_bar);
+ STAP_RETVALUE = 600 + STAP_ARG_foo;
+%}
+
+probe begin {
+ q = baz(9001, "I'm in your dmesg making stupid jokes")
+ printf("%d\n", q)
+ exit()
+}
--- /dev/null
+#! /bin/sh
+
+stap -g -p4 --compatible=1.7.9 -e '
+# test accessing locals using THIS->foo in legacy mode
+function baz:long(foo:long, bar:string)
+%{
+ printk("%s\n", THIS->bar);
+ THIS->__retvalue = 600 + THIS->foo;
+%}
+
+probe begin {
+ q = baz(9001, "I am in your dmesg making stupid jokes")
+ printf("%d\n", q)
+ exit()
+}
+'