doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/bz10078.c
raw| 1 | #include <stdlib.h> |
| 2 | #include <stdio.h> |
| 3 | |
| 4 | struct point { int x, y; }; |
| 5 | |
| 6 | struct point mkpoint2(void) __attribute__((noinline)); |
| 7 | struct point mkpoint2(void) |
| 8 | { |
| 9 | struct point p = { 1, 2 }; |
| 10 | return p; |
| 11 | } |
| 12 | |
| 13 | struct point mkpoint1(void) __attribute__((noinline)); |
| 14 | struct point mkpoint1(void) |
| 15 | { |
| 16 | return mkpoint2(); |
| 17 | } |
| 18 | |
| 19 | int main() |
| 20 | { |
| 21 | struct point p = mkpoint1(); |
| 22 | printf("%d,%d\n", p.x, p.y); |
| 23 | exit(0); |
| 24 | } |