Beispiel #1
0
void
testfunc2 ()
{
  foo_i (i);
  foo_i (d32);
  foo_i (d64);
  foo_i (d128);
  foo_d32 (i);
  foo_d32 (f);
  foo_d32 (ld);
  foo_d32 (d32);
  foo_d32 (d64);
  foo_d32 (d128);
  foo_d64 (i);
  foo_d64 (f);
  foo_d64 (ld);
  foo_d64 (d32);
  foo_d64 (d64);
  foo_d64 (d128);
  foo_d128 (i);
  foo_d128 (f);
  foo_d128 (ld);
  foo_d128 (d32);
  foo_d128 (d64);
  foo_d128 (d128);
}
Beispiel #2
0
void
testfunc2 ()
{
  foo_i (i);
  foo_i (f);
  foo_i (ld);
  foo_i (cd);

  foo_f (i);
  foo_f (f);
  foo_f (ld);
  foo_f (cd);

  foo_ld (i);
  foo_ld (f);
  foo_ld (ld);
  foo_ld (cd);

  foo_cd (i);
  foo_cd (f);
  foo_cd (ld);
  foo_cd (cd);
}
Beispiel #3
0
void
testfunc1 ()
{
  foo_i (i);
  foo_i (f); /* { dg-warning "as integer rather than floating" "prototype conversion warning" } */
  foo_i (ld); /* { dg-warning "as integer rather than floating" "prototype conversion warning" } */
  foo_i (cd); /* { dg-warning "as integer rather than complex" "prototype conversion warning" } */

  foo_f (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
  foo_f (f); /* { dg-warning "as `float' rather than `double'" "prototype conversion warning" } */
  foo_f (ld); /* { dg-warning "as `float' rather than `double'" "prototype conversion warning" } */
  foo_f (cd); /* { dg-warning "as floating rather than complex" "prototype conversion warning" } */

  foo_ld (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
  foo_ld (f);
  foo_ld (ld);
  foo_ld (cd); /* { dg-warning "as floating rather than complex" "prototype conversion warning" } */

  foo_cd (i); /* { dg-warning "as complex rather than integer" "prototype conversion warning" } */
  foo_cd (f); /* { dg-warning "as complex rather than floating" "prototype conversion warning" } */
  foo_cd (ld); /* { dg-warning "as complex rather than floating" "prototype conversion warning" } */
  foo_cd (cd);
}
Beispiel #4
0
void
testfunc1 ()
{
  foo_i (i);
  foo_i (d32); /* { dg-warning "as integer rather than floating" "prototype conversion warning" } */
  foo_i (d64); /* { dg-warning "as integer rather than floating" "prototype conversion warning" } */
  foo_i (d128); /* { dg-warning "as integer rather than floating" "prototype conversion warning" } */
  foo_d32 (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
  foo_d32 (f); /* { dg-warning "as '_Decimal32' rather than 'float'" "prototype conversion warning" } */
  foo_d32 (ld); /* { dg-warning "as '_Decimal32' rather than 'long double'" "prototype conversion warning" } */
  foo_d32 (d64); /* { dg-warning "as '_Decimal32' rather than '_Decimal64'" "prototype conversion warning" } */
  foo_d32 (d128); /* { dg-warning "as '_Decimal32' rather than '_Decimal128'" "prototype conversion warning" } */
  foo_d64 (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
  foo_d64 (f); /* { dg-warning "as '_Decimal64' rather than 'float'" "prototype conversion warning" } */
  foo_d64 (ld); /* { dg-warning "as '_Decimal64' rather than 'long double'" "prototype conversion warning" } */
  foo_d64 (d32); /* { dg-bogus "as '_Decimal64' rather than '_Decimal32'" "prototype conversion warning" } */
  foo_d64 (d128); /* { dg-warning "as '_Decimal64' rather than '_Decimal128'" "prototype conversion warning" } */
  foo_d128 (i); /* { dg-warning "as floating rather than integer" "prototype conversion warning" } */
  foo_d128 (f); /* { dg-warning "as '_Decimal128' rather than 'float'" "prototype conversion warning" } */
  foo_d128 (ld); /* { dg-warning "as '_Decimal128' rather than 'long double'" "prototype conversion warning" } */
  foo_d128 (d32); /* { dg-bogus "as '_Decimal128' rather than '_Decimal32'" "prototype conversion warning" } */
  foo_d128 (d64); /* { dg-bogus "as '_Decimal128' rather than '_Decimal64'" "prototype conversion warning" } */
  foo_d128 (d128); /* { dg-bogus "as '_Decimal128' rather than '_Decimal'" "prototype conversion warning" } */
}
Beispiel #5
0
int
main (void)
{
  volatile int a[5];
  a[4] = 1;
  a[2] = a[3];
  fn_p (a[4]);
  fn_a (a);

  int i = 4;
  a[i] = 1;
  a[2] = a[i];
  fn_p (a[i]);
  foo_i (i);

  const int n = 5;
  volatile int b[n];
  b[4] = 1;
  b[2] = b[3];
  fn_p (b[4]);
  fn_a (b);

  volatile int c[n][n][n];
  c[2][2][2] = 2;
  i = c[4][4][4];

  volatile struct S s;
  s.a[9] = 1;
  i = s.a[9];

  /* Don't instrument flexible array members.  */
  struct T *t = (struct T *) __builtin_malloc (sizeof (struct T) + 10);
  t->a[1] = 1;

  struct U *u = (struct U *) __builtin_malloc (sizeof (struct U) + 10);
  u->a[1] = 1;

  long int *d[10][5];
  d[9][0] = (long int *) 0;
  d[8][3] = d[9][0];

  return 0;
}
Beispiel #6
0
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
  try
    {
      CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);

      if (parse_args (argc, argv) != 0)
        return 1;

      CORBA::Object_var poa_object =
              orb->resolve_initial_references("RootPOA");

      PortableServer::POA_var root_poa =
              PortableServer::POA::_narrow (poa_object.in ());

      if (CORBA::is_nil (root_poa.in ()))
        ACE_ERROR_RETURN ((LM_ERROR,
                           " (%P|%t) Panic: nil RootPOA\n"),
                          1);

      PortableServer::POAManager_var poa_manager =
        root_poa->the_POAManager ();

      foo_i* server_impl = 0;
      ACE_NEW_RETURN (server_impl,
                      foo_i (orb.in ()),
                      1);
      PortableServer::ServantBase_var owner_transfer(server_impl);

      PortableServer::ObjectId_var id =
        root_poa->activate_object (server_impl);

      CORBA::Object_var object = root_poa->id_to_reference (id.in ());

      foo_var server = foo::_narrow (object.in ());

      CORBA::String_var ior =
        orb->object_to_string (server.in ());

      // Output the IOR to the <ior_output_file>
      FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
      if (output_file == 0)
        ACE_ERROR_RETURN ((LM_ERROR,
                           "Cannot open output file for writing IOR: %s",
                           ior_output_file),
                           1);
      ACE_OS::fprintf (output_file, "%s", ior.in ());
      ACE_OS::fclose (output_file);

      poa_manager->activate ();

      orb->run ();

      root_poa->destroy (1, 1);
      orb->destroy ();
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception ("CORBA::Exception");
    }

  return 0;
}