]> sourceware.org Git - systemtap.git/commitdiff
testsuite/systemtap.base/vta-test.c: Tweaked to use variables.
authorMark Wielaard <mjw@redhat.com>
Fri, 11 Nov 2011 11:23:25 +0000 (12:23 +0100)
committerMark Wielaard <mjw@redhat.com>
Fri, 11 Nov 2011 11:23:25 +0000 (12:23 +0100)
GCC 4.6 was too smart. It saw we didn't actually use the a[] ever
so never stored its contents. Now we actually use the array so a
(constant) expresion location is put in the dwarf output.

testsuite/systemtap.base/vta-test.c

index ad3bd937b51c9b1e0a6d28e22fcbc3fc90f560c5..53c5dc9b8e86a6ed5a63915fcdac21193f205750 100644 (file)
@@ -16,7 +16,7 @@ struct cull
   unsigned long long i;
 };
 
-void
+int
 t1 (int i)
 {
   int a[] = { 17, 23 };
@@ -29,9 +29,10 @@ t1 (int i)
   STAP_PROBE(test, t1);
   c.i = i;
   srandom (c.i + 4);
+  return a[0] + a[1];
 }
 
-void
+int
 t2 (unsigned int i)
 {
   int a[] = { 17, 23 };
@@ -44,9 +45,10 @@ t2 (unsigned int i)
   STAP_PROBE(test, t2);
   c.i = i;
   srandom (c.i + 4);
+  return a[0] + a[1];
 }
 
-void
+int
 t3 (unsigned long long i)
 {
   int a[] = { 17, 23 };
@@ -59,13 +61,14 @@ t3 (unsigned long long i)
   STAP_PROBE(test, t3);
   c.i = i;
   srandom (c.i + 4);
+  return a[0] + a[1];
 }
 
 int
 main (int argc, char **argv)
 {
-  t1 (42);
-  t2 (42);
-  t3 (42);
-  return 0;
+  int i1 = t1 (42);
+  int i2 = t2 (42);
+  int i3 = t3 (42);
+  return 2*i1 - i2 - i3;
 }
This page took 0.030063 seconds and 5 git commands to generate.