Beispiel #1
0
void foobar(Y::X_type)
   {
  // Both of these are unparsed t: foobar(::X < int > ::X());
  // This can be important to do when Y::X_type is a private type.
     foobar(X<A::A_type>());
     foobar(Y::X_type());
   }
void foo(int s) {
  unsigned loc = 0;
  if (s) {
    loc = 1;
    foobar();
  } else {
    loc = bar();
    foobar();
  }
}
Beispiel #3
0
void f() {
    foobar (xyz,
	fsfgnu (aaa, bbb + ccc
		     + ddd
	    )
	);
    foobar (xyz, fsfgnu (aaa, bbb + ccc
			      + ddd
		     )
	);
}
Beispiel #4
0
int main(void)
{
    printf("leakfinder C example app\n");
    printf("This application is expected to leak\n");

    foobar(8);
    foobar(16);

    printf("leakfinder C example app all done\n");
    return 0;
}
Beispiel #5
0
EXPORT_SYM
int main()
{
    foobar(0x0eadbeef,0x0eedfeed);
    baz(1,2,3);
    return 0;
}
Beispiel #6
0
int main( void )
{
    foobar();
    foobar2();
    CHECK_GOOD( 744 );
    return 0;
}
Beispiel #7
0
int main(void) {
  int num = 16;
  float *a = createvect(num),
        *b = createvect(num),
        *c = createvect(num);
  
  setvect(NUM, a, 1);
  setvect(NUM, b, 1);
  setvect(NUM, c, 1);
  int i;
  for (i = 0; i != num; i++) {
    a[i] = i;
    b[i] = num - i - 1;
  }
 
  // given addition test
  foobar(NUM, a, b, c);
  printf("0: a = ");
  printvect(NUM, a);
  printf("\n");
  printf("   b = ");
  printvect(NUM, b);
  printf("\n");
  printf("   c = ");
  printvect(NUM, c);
  printf("\n");

  return 0;
}
Beispiel #8
0
void main (void)
{
    log ("Calling overlay 1 from main");

    /* The symbols _OVERLAY1_LOAD__ and _OVERLAY1_SIZE__ were generated by the
     * linker. They contain the overlay area address and size specific to a
     * certain program.
     */
    if (loadfile ("ovrldemo.1", _OVERLAY1_LOAD__, _OVERLAY1_SIZE__)) {

        /* The linker makes sure that the call to foo() ends up at the right mem
         * addr. However it's up to user to make sure that the - right - overlay
         * is actually loaded before making the the call.
         */
        foo ();
    }

    log ("Calling overlay 2 from main");

    /* Replacing one overlay with another one can only happen from the main
     * program. This implies that an overlay can never load another overlay.
     */
    if (loadfile ("ovrldemo.2", _OVERLAY2_LOAD__, _OVERLAY2_SIZE__)) {
        bar ();
    }

    log ("Calling overlay 3 from main");
    if (loadfile ("ovrldemo.3", _OVERLAY3_LOAD__, _OVERLAY3_SIZE__)) {
        foobar ();
    }

    cgetc ();
}
Beispiel #9
0
int main()
{
  if (foobar (1) != 1)
    abort ();

  return 0;
}
Beispiel #10
0
int
main (int argc, char **argv)
{
  if (__builtin_constant_p (argc))
    foobar ();
  return 0;
}
Beispiel #11
0
many_par (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)
{
  char *x;
  int aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa;

  aa = bar ();
  ba = bar ();
  ca = bar ();
  da = bar ();
  ea = bar ();
  fa = bar ();
  ga = bar ();
  ha = bar ();
  ia = bar ();
  ja = bar ();
  ka = bar ();
  la = bar ();
  ma = bar ();
  na = bar ();
  oa = bar ();
  pa = bar ();
  foobar (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, aa, ba, ca,
	  da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa);

}
Beispiel #12
0
int main(int argc, char* argv[])
{
  int i;
  int nreg;
  region_t *rlist;
  region_t *newstack;

  rstack_init(0);

  for( i=0; i<3; i++ ) {
    foobar();
    bar();
    foobar();
  }

  /* print the original stack */
  traverse_rstack(ipm_rstack, 0,
		  rsfunc_print_region, stderr);
  fprintf(stderr, "\n");

  /* count the regions, allocate space for linearization */
  nreg = rstack_count_all_regions(ipm_rstack);
  rlist = (region_t*) malloc(sizeof(region_t)*nreg);

  fprintf(stderr, "Counted %d regions in stack\n\n", nreg);
  
  /* pack the stack in list */
  rstack_pack(ipm_rstack, nreg, rlist);

  /* clean-up old stack */
  traverse_rstack(ipm_rstack, 0, rsfunc_cleanup, 0);

  /* unpack again to get new stack */
  newstack = rstack_unpack(nreg, rlist);

  /* print new stack */
  traverse_rstack(newstack, 0,
		  rsfunc_print_region, stderr);
  fprintf(stderr, "\n");

  fprintf(stderr, "Counted %d regions in new stack\n",
	  rstack_count_all_regions(newstack));

  traverse_rstack(newstack, 0, rsfunc_cleanup, 0);  

  return 0;
}
Beispiel #13
0
int main(int argc, char* argv[]) {
  foo(0);
  foobar(1);
  bar();
  fourbar();

  return 0;
}
Beispiel #14
0
  void fooY() {
    F f1;
    foobar(); 
#if !PUREONLY
  	// expected-warning-re@-2 {{{{^}}Call to virtual function during construction}}
  	// expected-note-re@-3 {{{{^}}Call to virtual function during construction}}
#endif
  }
Beispiel #15
0
void foo::prod ()
   {
  // Error if global scope name qualification is dropped in generated code!
     ::prod (0);

  // Error if global scope name qualification is dropped in generated code!
     ::x = &x;

  // Error if global scope name qualification is dropped in generated code!
     float *y1 = foobar();
     float *y2 = (::xType) foobar();
     float *y3 = static_cast< ::xType >(foobar());

     float *y4 = ::x;

     ::xType z = &x;
   }
Beispiel #16
0
int main(int argc, char* argv[]) {
  foobar();
  A *a = new A();
  a->foo();
  (*a).foo();
  C *e = new E();
  e->foo2();
  e->bar2();
}
// This is a test code for the Interl Pin support in ROSE,
// it is used as input to the ROSE pin tool (run by pin).
int
main()
   {
  // x = foobar();
     for (int i=0; i < 10; i++)
        {
          x++;
        }

     if (x < 0)
        {
          printf ("Took a rare branch! \n");
          x = foobar();
          x = foobar();
        }

     return 0;
   }
int main(int argc, char **argv)
{
        int foobar_val;

	foobar(&foobar_val);

	printf("foobar_val: %d\n",foobar_val);

        return(0);
}
Beispiel #19
0
int main() {
  int r = 0;
  r += (int)foo((float)r);
  r += 1;
  r += bar(r, (float)r);
  r += 2;
  r += foobar((double)r, (double)r);
  r += 3;
  return r;
}
Beispiel #20
0
int main(void) {
   int *x = (int *) malloc(sizeof(int));  /* the pointer x is stored in the 
                                             stack frame for main and the int 
                                             itself is stored in the heap */
   *x = MAX;
   double b = 2.5;
   foobar(*x, b);
   MAX = 5;
   return 0;
}
Beispiel #21
0
void func1 () 
   {
  // _mm_set_ps((float)0.0, (float)0.0, (float)0.0, (float)0.0);
  // foobar(0.0F, 0.0F, 0.0F, 0.0F);
#if 0
     foobar(0); 
#else
     _mm_set_ps(0.0, 0.0, 0.0, 0.0);
#endif
   }
Beispiel #22
0
    void foobar_member_function()
    {
        // This will fail (seems it has to be a part of a template).
        // It should output: "map<int>::iterator it;"
        map<int>::iterator it;
        // map::iterator it;

        // Call the templated function.
        map<int>::iterator x;
        foobar(x);
    }
Beispiel #23
0
int
main()
{
  A aaa; // { dg-warning "is deprecated" }
  int n = foo(12); // { dg-warning "is deprecated" }

  B bbb; // { dg-warning "is deprecated" "B has been superceded by C" }
  int m = bar(666); // { dg-warning "is deprecated" "bar is unsafe; use foobar instead" }

  C ccc; // { dg-warning "is deprecated" }
  int l = foobar(8); // { dg-warning "is deprecated" }
}
Beispiel #24
0
int
main()
{
  A aaa; // { dg-warning "is deprecated" }
  int n = foo(12); // { dg-warning "is deprecated" }

  B bbb; // { dg-warning "is deprecated" }
  int m = bar(666); // { dg-warning "is deprecated" }

  C ccc; // { dg-warning "is deprecated" "" { target { c++14 } } }
  int l = foobar(8); // { dg-warning "is deprecated" "" { target { c++14 } } }
}
Beispiel #25
0
/* ARGSUSED */
int
main(int argc, char* argv[])
{
	int a = 0;

	foo(0);		   /* ok, promotion of in-range constant 	  */
	foo(a);		   /* warning: promotion of non-constant 	  */
	foobar(INTMAX_MAX);/* warning: promotion of out-of-range constant */
	bar(-1);	   /* warning: promotion of out-of-range constant */
	bar(0);		   /* ok, promotion of in-range constant 	  */
	return 0;
}
Beispiel #26
0
void
PlacementNew::UnitTest()
{
    Trace t("PlacementNew::UnitTest()");
    t.Info( "Calling New(17)..." );
    New(17);
    t.Info( "Calling New(3.14)..." );
    New(3.14);
    t.Info( "Calling New(PlacementNew(10))..." );
    PlacementNew foobar(10);
    New( foobar );
}
Beispiel #27
0
unsigned int f(int *devspec, unsigned int addr)
{
 reg_gio_rw_i2c1_ctrl ctrl = {0};
 reg_gio_rw_i2c1_data data = {0};

 foobar();

 static int first = 1;

 if (first) {
  reg_gio_rw_i2c1_cfg cfg = {0};
  first = 0;

  foo(1);
  cfg.sda0_idle = 1;
  cfg.sda0_io = 0;
  cfg.scl_inv = 0;
  cfg.scl_io = 0;
  cfg.bit_order = 1;
  cfg.sda_sel = 0;
  cfg.sen_sel = 0;
  cfg.en = 1;
  reg_gio = cfg;
 }

 ctrl.freq = 1;
 ctrl.start_bit = 0;
 ctrl.ack_bit = 1;
 ctrl.ack_dir0 = 0;
 ctrl.ack_dir1 = 0;
 ctrl.ack_dir2 = 0;
 ctrl.ack_dir3 = 1;
 ctrl.ack_dir4 = 0;
 ctrl.ack_dir5 = 0;
 ctrl.start_stop = 1;
 ctrl.early_end = 0;
 ctrl.extra_start = 2;
 ctrl.switch_dir = 8*3;
 ctrl.trf_bits = 8*4;
 reg_ctrl = ctrl;
 frob(0xac);
 data.data0 = devspec[1] & 192;
 data.data1 = addr;
 data.data2 = devspec[1] | 0x01;
 reg_data = data;
 reg_start = 1;
 bar(100);
 data = reg_data;
 baz();

 return data.data3;
}
Beispiel #28
0
//===
int pointer(){
    test_pointer_cast2();
    //cast();    
    int val = 0;
    int *p2 = &val;
    std::cout<<"test pointer\n";
    testPointer();
    //std::cout<<"test addr\n";
    //test_addr();
    val = foobar(p2);
    std::cout << "val:" << val;
    return 0;
}
bar(int local_p)
{
  int x = 0;
  int *j;
  int **p;
  if (local_p)
    p = &j;
  else
    p = foobar();
  *p = &x;  /* This makes x escape.  */
  foo ();
  return x;
}
Beispiel #30
0
void foo(void)
{
   if ((a != 0)
       && (b == 0)
       && (c < 0) && (d > 0))
   {
      printf("hi");
   }

   if (flag1
#ifdef FLAG2
       || flag2
#endif
       )
   {
      printf("yar");
   }

   if ((a != 0)
       && (b == 0)
       && (c < 0))
   {
      printf("hi");
   }

   if ((a != 0)
       &&
       (b == 0)
       &&
       (c < 0))
   {
      printf("hi");
   }

   if (!this->writeOwiFile ()                   // comment1
       || broken () || !saveArchiveData ()      /* comment2 */
       || broken () || !deleteCentralArchive () // comment3
       || broken () || !copyArchivFiles ()      // comment4
       || broken () || !appendToPlanetDb ())    // comment5
   {
      ;
   }

   foobar(param1
          , param2, param3
          , param4);

   foobar2(param1
           , param2, param3
           , param4);
}