Exemple #1
0
int
main ()
{
  int x;

  /* Use comma operator to sequence evaluation of bar and foo.  */
  x = baz ((bar (), foo ()));

  test_skip_file_and_function ();

  return 0;
}
void
fn1 (T i)
{
  for ((i += 2); auto x : a)
    foo (i);

  for (auto j = 0, k = 0; auto x : a)
    bar (j + k, x);

  for (constexpr int j = baz (); auto x : a)
    bar (x, j);
}
Exemple #3
0
__attribute__ ((ms_abi, noinline, noclone)) void
foo (void)
{
  unsigned d;
  unsigned short *e;
  if ((d = bar ()))
    {
      e = baz (d * sizeof (unsigned short) + 20);
      __builtin_memcpy (e, b, d * sizeof (unsigned short));
      c = e;
    }
}
Exemple #4
0
void
f6 (const std::vector<int>::const_iterator &x,
    const std::vector<int>::const_iterator &y)
{
#pragma omp parallel for schedule (runtime)
  for (std::vector<int>::const_iterator i = x + 2000 - 64;
       i > y + 10; i = i - 12 + 2)
    {
      std::vector<int>::const_iterator j = i + N;
      baz (j);
    }
}
int
foo (int i)
{
  int j; /* { dg-warning "'j' may be used uninitialized in this function" "uninitialized" { xfail *-*-* } 8 } */

  if (bar (i)) { 
    baz (&j);
  } else {
  }

  return j;
}
Exemple #6
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;
}
Exemple #7
0
main ()
{
  if (foo (0x56789LL) != 0x26f32e5d26f32e5dLL)
    abort ();
  a = 0x8000000080000000LL;
  b = 0x0000000180000001LL;
  if (bar () != 0x120480000735LL)
    abort ();
  p = 0xffffffff;
  if (baz () != 0xac00000000LL)
    abort ();
  exit (0);
}
Exemple #8
0
void
benchmark (void)
{
 int y, z;
 
 y = 2;
 z = 9;
 y = foo ();
 z = y;
 y = y + 2;
 y = baz ();
 return 0;
}
Exemple #9
0
int
main ()
{
  C c;
  if (foo (static_cast<B *> (&c)) != &c)
    __builtin_abort ();
  if (foo (0))
    __builtin_abort ();
  if (bar (static_cast<B *> (&c)) != &c)
    __builtin_abort ();
  baz (0);
  return 0;
}
Exemple #10
0
int
main ()
{
  fn = throw0;
  asm volatile ("" : : : "memory");
  try
    {
      baz (5);
    }
  catch (int)
    {
    }
}
  void test_to_string()
  {
    cppxml::xml_node foo("foo", "n", "http://fake_domain/fake_ns");
    foo.add_namespace("n", "http://fake_domain/fake_ns");
    cppxml::xml_node bar("bar", "n", "http://fake_domain/fake_ns");
    cppxml::xml_node baz("baz", "n", "http://fake_domain/fake_ns");
    bar.add_child(std::make_shared<cppxml::xml_node>(baz));
    foo.add_child(std::make_shared<cppxml::xml_node>(bar));

    std::string tos = foo.to_string();
    std::string expected("<n:foo xmlns:n=\"http://fake_domain/fake_ns\">\n   <n:bar>\n      <n:baz/>\n   </n:bar>\n</n:foo>\n");
    CPPUNIT_ASSERT(tos == expected);
  }
  int r1(int n){
    int b = n+1;
    short int c[2][n];

    #pragma omp target if(n>60)
    {
      this->a = (double)b + 1.5;
      c[1][1] = ++a;
      baz(a, a);
    }

    return c[1][1] + (int)b;
  }
int main()
{
    char text[] = "world";

    String s0;
    String s1("hello");
    std::cout << "s1" << std::endl;
    String s2(s0);
    std::cout << "s2" << std::endl;
    String s3 = s1;
    std::cout << "s3" << std::endl;
    String s4(text);
    std::cout << "s4" << std::endl;
    s2=s1;
    std::cout << "s2=s1" << std::endl;

    foo(s1);
    bar(s1);
    foo("temporary");
    bar("temporary");
    String s5 = baz();

    std::vector<String> svec;
    svec.reserve(8);
    svec.push_back(s0);
    svec.push_back(s1);
    svec.push_back(s2);
    svec.push_back(s3);
    svec.push_back(s4);
    svec.push_back(s5);
    svec.push_back(baz());
    svec.push_back("good job");

    for (const auto& s : svec)
    {
        std::cout << s.c_str() << std::endl;
    }
}
Exemple #14
0
void foo(void)
{
  int u;

  void bar(int val)
    {
      u = val;
    }

  static struct S s = { bar }; /* { dg-error "(is not constant)|(near initialization)" } */

  baz(&s);
  p(u);
}
Exemple #15
0
int *
test (unsigned x, struct A *y)
{
  unsigned v;
  if (foo () || y[x].a == -1)
    {
      c = bar (x);
      return 0;
    }
  v = y[x].a;
  if (v >= 23)
    baz ();
  return b[v];
}
Exemple #16
0
int main(int argc, char *argv[]) {

  std::bitset<16> foo;
  std::bitset<16> bar (0xfa2);
  std::bitset<16> baz (std::string("0101111001"));

  std::cout << "foo: " << foo << '\n';
  std::cout << "bar: " << bar << '\n';
  std::cout << "baz: " << baz << '\n';

  std::cout << "The fifth bit of bar is " << bar[5] << "\n";

  return 0;
}
Exemple #17
0
int
main ()
{
  int i;
  for (i = 0; i < 32 * 32; i++)
    d[i] = (i & 31);
  if (foo (32 * 32, 32) != (31 * 32 / 2) * 32)
    abort ();
  if (bar (32 * 32) != (31 * 32 / 2) * 32)
    abort ();
  if (baz (32 * 32) != (31 * 32 / 2) * 32)
    abort ();
  return 0;
}
Exemple #18
0
int
main (int argc, short *argv[])
{
  vector short fetched_value = foo ();
  if (fetched_value[0] != 0 || fetched_value[7] != 7)
    abort ();

  fetched_value = foo1 ();
  if (fetched_value[1] != 1 || fetched_value[6] != 6)
    abort ();

  fetched_value = foo2 ();
  if (fetched_value[2] != 2 || fetched_value[5] != 5)
    abort ();

  fetched_value = foo3 (&x);
  if (fetched_value[3] != 3 || fetched_value[4] != 4)
    abort ();

  struct bar a_struct;
  a_struct.a_vector = x;	/* Remove 2 redundant swaps.  */
  fetched_value = foo4 (&a_struct);
  if (fetched_value[4] != 4 || fetched_value[3] != 3)
    abort ();

  for (int i = 0; i < 8; i++)
    z[i] = 7 - i;

  baz (z);
  if (x[0] != 7 || x[7] != 0)
    abort ();

  vector short source = { 8, 7, 6, 5, 4, 3, 2, 1 };

  baz1 (source);
  if (x[3] != 5 || x[7] != 1)
    abort ();

  vector short dest;
  baz2 (&dest, source);
  if (dest[4] != 4 || dest[1] != 7)
    abort ();

  baz3 (&a_struct, source);
  if (a_struct.a_vector[7] != 1 || a_struct.a_vector[5] != 3)
    abort ();

  return 0;
}
Exemple #19
0
void foo (int j, int k)
{
  int i;

  /* Valid loops.  */
  #pragma omp for
  for (i = 0; i < 10; i++)
    baz (i);

  #pragma omp for
  for (i = j; i <= 10; i+=4)
    baz (i);

  #pragma omp for
  for (i = j; i > 0; i = i - 1)
    baz (j);

  #pragma omp for
  for (i = j; i >= k; i--)
    baz (i);

  // Malformed parallel loops.
  #pragma omp for
  i = 0;		// { dg-error "for statement expected" }
  for ( ; i < 10; )
    {
      baz (i);
      i++;
    }

  #pragma omp for
  for (i = 0; ; i--)	// { dg-error "missing controlling predicate" }
    {
      if (i >= 10)
	break;		// { dg-error "break" }
      baz (i);
    }

  #pragma omp for
  for (i = 0; i < 10 && j > 4; i-=3)	// { dg-error "invalid controlling predicate" }
    baz (i);

  #pragma omp for
  for (i = 0; i < 10; i-=3, j+=2)	// { dg-error "invalid increment expression" }
    baz (i);
}
    // Foo description
    void foo()
    {
        if (a == b)
        {
// Col1 comment
// Col1 comment
// Col1 comment
            // Baz description
            baz(); // Baz trailing comment begin
                   // Baz trailing comment ...
                   // Baz trailing comment end
        } // if (a == b)
        // Bar description begin
        // Bar description ...
        // Bar description end
        bar(
            a,
            b
            ); // bar trailing comment begin
               // bar trailing comment ...
               // Baz trailing comment end
        /*! Baz description begin
         * Baz description ...
         * Baz description end */
        baz(a,
            b); /* Baz trailing comment begin
                   Baz trailing comment ...
                   Baz trailing comment end */
        // Bar description
        bar(); // bar trailing comment begin
               // bar trailing comment ...
               // Baz trailing comment end

        // Baz description
        baz();
    }
Exemple #21
0
int main()
{
  jmp_buf buf;
  int ret;

  printf("Inside main\n");

  if ((ret = setjmp(buf)) != 0) {
    printf("ret == %d\n", ret);
  } else {
    baz(buf);
  }

  return 0;
}
Exemple #22
0
int
main ()
{
  int i;
  check_vect ();
  bar ();
  for (i = 0; i < N; i++)
    if (array[i] != (i < 30 ? 5 : i * 4 + 123))
      abort ();
  baz ();
  for (i = 0; i < N; i++)
    if (array[i] != (i < 30 ? 5 : i * 8 + 123))
      abort ();
  return 0;
}
Exemple #23
0
int main(void) {
    tree s = prompt_tree();
    printf("s = ");
    print_tree(s);
    tree t = prompt_tree();
    printf("t = ");
    print_tree(t);
    tree r = baz(s, t);
    printf("baz(s, t) = ");
    print_tree(r);
    free_tree(r);
    free_tree(s);
    free_tree(t);
    return 0;
}
Exemple #24
0
void foo(Args&&... args)
{
    auto a = {bar(args)...};

    for (const auto& elt : a)
    {
        std::cout << elt << ' ';
    }

    auto v = {(baz(args), 0)...};
    (void) v;
    
    auto over = {(overload_comma(args), void(), 0)...};
    (void) over;
}
Exemple #25
0
int main(void) {
      ((int (*)())f)(0, 0);

      ((int (*)())g)(0.0);

      int bar();
      bar(5.0);

      int baz();
      baz((char)5);

      int bah();
      bah(5);

      return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{
	std::vector<String> vecstr;
	String str1("tangbin");
	String str2("tangbin");
	if (str1 == str2)
		std::cout << "same" << std::endl;

	vecstr.push_back(str2);
	vecstr.push_back(str1);
	String s5 = baz(); // second avoided
	//vecstr.push_back(str2);
	//vecstr.push_back(str3);
	system("pause");
	return 0;
}
Exemple #27
0
void
interval_pl (FunctionCallInfo fcinfo)
{
  Interval *span1 = ((Interval *) ((char *) ((fcinfo->arg[0]))));
  Interval *span2 = ((Interval *) ((char *) ((fcinfo->arg[1]))));
  Interval *result = (Interval *) palloc (sizeof (Interval));

  /* Should emit 2x div0s.  */
  if ((((span1->month) < 0) == ((span2->month) < 0))
      && !(((result->month) < 0) == ((span1->month) < 0)))
    do {
      if (bar ())
	baz ();
    } while(0);
  result->day = span1->day + span2->day;
}
Exemple #28
0
void
foo (int y)
{
  int a = 0;
  if (y == 6)
    {
      a += bar (7);
      a += bar2 (6);
    }
  else
    {
      a += bar2 (6);
      a += bar (7);
    }
  baz (a);
}
Exemple #29
0
int
main ()
{
#ifdef LOOP
  signal (SIGINT, &int_handler);
  // signal (SIGALRM, &alrm_handler);
  // alarm (300);
#endif
  bar(2);
  baz(3,(char*)"abc");
  buz(4);
#ifdef LOOP
  while (1) {nanosleep(&req, NULL);}
#endif
  return 0;
}
Exemple #30
0
int main ()
{
  __complex__ double x;
  __complex__ float y;
  __complex__ long double z;
  __real__ x = 1.0;
  __imag__ x = 2.0;
  foo (x);
  __real__ y = 3.0f;
  __imag__ y = 4.0f;
  bar (y);
  __real__ z = 5.0L;
  __imag__ z = 6.0L;
  baz (z);
  exit (0);
}