OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [variadic68.C] - Rev 693

Compare with Previous | Blame | View Log

// { dg-do run }
// { dg-options "-std=gnu++0x" }
extern "C" void abort();

template<typename T, T... Values>
void f(T* expected_values, int n)
{
  if (sizeof...(Values) != n)
    abort ();

  T values[] = { Values... };
  for (int i = 0; i < n; ++i)
    if (values[i] != expected_values[i])
      abort();
}

int main()
{
  int test_arr1[3] = { 1, 2, 3 };
  f<int, 1, 2, 3>(test_arr1, 3);

  return 0;
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.