diff options
author | Dave Brolley <brolley@redhat.com> | 2009-11-23 19:08:51 -0500 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-11-23 19:08:51 -0500 |
commit | 5d1c958ce2dcc0f28c1bd13b8e005c0c2ad1cdba (patch) | |
tree | e44ad8807e0b5b2e1bb85682f677d492f1195dbf /testsuite/systemtap.base/externalvar_lib.c | |
parent | 562d60b004e3d7ae73c1c7508be529006bd6430f (diff) | |
parent | 90bba7158de040705a101ba1fdf6062866b4b4e9 (diff) | |
download | systemtap-steved-5d1c958ce2dcc0f28c1bd13b8e005c0c2ad1cdba.tar.gz systemtap-steved-5d1c958ce2dcc0f28c1bd13b8e005c0c2ad1cdba.tar.xz systemtap-steved-5d1c958ce2dcc0f28c1bd13b8e005c0c2ad1cdba.zip |
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Conflicts:
configure
Diffstat (limited to 'testsuite/systemtap.base/externalvar_lib.c')
-rw-r--r-- | testsuite/systemtap.base/externalvar_lib.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/externalvar_lib.c b/testsuite/systemtap.base/externalvar_lib.c new file mode 100644 index 00000000..9017e798 --- /dev/null +++ b/testsuite/systemtap.base/externalvar_lib.c @@ -0,0 +1,43 @@ +/* external var test case - library helper + * Copyright (C) 2009, Red Hat Inc. + * + * This file is part of systemtap, and is free software. You can + * redistribute it and/or modify it under the terms of the GNU General + * Public License (GPL); either version 2, or (at your option) any + * later version. + * + * Tests that an external exported variable can be accessed. + */ + +#include <stdlib.h> + +struct libstruct +{ + int i; + long l; + char c; + struct libstruct *s1; + struct libstruct *s2; +}; + +int libvar; +struct libstruct *lib_s; + +static void +lib_call () +{ + asm(""); // dummy method, just to probe and extract. +} + +void +lib_main () +{ + libvar = 42; + lib_s = (struct libstruct *) malloc(sizeof(struct libstruct)); + lib_s->i = 1; + lib_s->l = 2; + lib_s->c = 3; + lib_s->s1 = lib_s; + lib_s->s2 = NULL; + lib_call (); +} |