Esempio n. 1
0
int
main ()
{
  volatile int l = 1;
  char b[64];

  if (memcmp (fn1 (l) - 1, "a", 2) != 0)
    abort ();
  if (memcmp (fn1 (!l) - 2, "bc", 3) != 0)
    abort ();
  if (fn2 (l) != 1 || fn2 (!l) != 3)
    abort ();
  memset (b, '\0', sizeof b);
  memset (b, 'a', 3);
  if (fn3 (b, 10) != 4 || memcmp (b, "aaaabcd", 8) != 0)
    abort ();
  if (fn3 (b, 128) != 7 || memcmp (b, "aaaabcdabcdefg", 15) != 0)
    abort ();
  if (fn3 (b, 256) != 10 || memcmp (b, "aaaabcdabcdefgabcdefgefg", 25) != 0)
    abort ();
  if (fn4 (b, 10) != 4
      || memcmp (b, "aaaabcdabcdefgabcdefgefgabcd", 29) != 0
      || memcmp (buf, "aaaabcdabcdefgabcdefgefg", 25) != 0)
    abort ();
  if (fn4 (b, 128) != 4
      || memcmp (b, "aaaabcdabcdefgabcdefgefgabcdabcd", 33) != 0
      || memcmp (buf, "aaaabcdabcdefgabcdefgefgabcdefg", 32) != 0)
    abort ();
  if (fn4 (b, 256) != 4
      || memcmp (b, "aaaabcdabcdefgabcdefgefgabcdabcdabcd", 37) != 0
      || memcmp (buf, "aaaabcdabcdefgabcdefgefgabcdabcdefgefg", 39) != 0)
    abort ();
  return 0;
}
Esempio n. 2
0
int
test (struct S *x)
{
  struct S *r;
  int m = 0;

  for (r = x; r != v; r = (fn3 (r)->d))
    if (r->c != 6)
      fn1 (x);
    else
      m |= 1 << (fn4 (fn3 (r)->e) - 1);
  return m;
}
Esempio n. 3
0
void FileFunctionsTestCase::setUp()
{
    // Under Unix we need to use UTF-8 for the tests using non-ASCII filenames
    // and this is not necessarily the case because the tests don't call
    // setlocale(LC_ALL, ""), so ensure it explicitly. This is just a temporary
    // hack until we find the solution to make the library work with Unicode
    // filenames irrespectively of the current locale.
#ifndef __DARWIN__
    m_convFNOld = wxConvFileName;
    wxConvFileName = &wxConvUTF8;
#endif

    // Initialize local data

    wxFileName fn1(wxFileName::GetTempDir(), wxT("wx_file_mask.txt"));
    m_fileNameASCII = fn1.GetFullPath();

    // This file name is 'wx_file_mask.txt' in Russian.
    wxFileName fn2(wxFileName::GetTempDir(),
      wxT("wx_\u043C\u0430\u0441\u043A\u0430_\u0444\u0430\u0439\u043B\u0430.txt"));
    m_fileNameNonASCII = fn2.GetFullPath();

    wxFileName fn3(wxFileName::GetTempDir(), wxT("wx_test_copy"));
    m_fileNameWork = fn3.GetFullPath();
}
void fn2(NowFileInfo* pFileInfo)
{
	ParamNode* pTempParamNode= NULL;
	
	if ( pFileInfo == NULL )
		return;

	printf("File Info : %s", pFileInfo->szFilePath);
	printf("\nFile Status: %d", pFileInfo->iStatus);

	pTempParamNode = (ParamNode*) malloc(sizeof(ParamNode));

	if ( pTempParamNode == NULL )
		return;

	memset(pTempParamNode, 0 ,sizeof( ParamNode ));

	pTempParamNode->iFileCount  = 5;
	pTempParamNode->ppNowFileInfo = (NowFileInfo**) malloc(pTempParamNode->iFileCount * sizeof(NowFileInfo*));

	if ( pTempParamNode == NULL )
		return;

	memset(pTempParamNode->ppNowFileInfo, 0 ,pTempParamNode->iFileCount* sizeof(NowFileInfo*));

	for(int iIndex = 0; iIndex< pTempParamNode->iFileCount ; iIndex++ )
	{
		pTempParamNode->ppNowFileInfo[iIndex] = (NowFileInfo*) malloc(sizeof(NowFileInfo));
		memcpy( pTempParamNode->ppNowFileInfo[iIndex], pFileInfo, sizeof(NowFileInfo));
	}

	fn3(pTempParamNode);
}
Esempio n. 5
0
int
main ()
{
  int i;
  char buf[64], buf2[64];
  for (i = 0; i < 5; i++)
    {
      const char *p = "abcdefghijklmnop" + (i < 3 ? i : 3) * 4;
      const char *q;
      q = fn1 (i, 1);
      if (memcmp (q - 4, p, 4) != 0 || q[0] != '\0')
	abort ();
      q = fn1 (i, 0);
      if (memcmp (q - 3, p, 4) != 0 || q[1] != '\0')
	abort ();
    }
  memset (buf, '\0', sizeof buf);
  memset (buf + 4, 'z', 2);
  if (fn2 (buf, buf2) != 6
      || memcmp (buf, "abcdzz", 7) != 0
      || memcmp (buf2, "abcdzz", 7) != 0)
    abort ();
  memset (buf, '\0', sizeof buf);
  memset (buf + 4, 'z', 2);
  if (fn3 (buf) != buf + 6 || memcmp (buf, "abcdzzefgh", 11) != 0)
    abort ();
  return 0;
}
Esempio n. 6
0
void fn2(void) {
  struct callchain_cursor *b = &a;
  while (1) {
    fn3();
    fn1(b);
  }
}
Esempio n. 7
0
int main() {
    int b[4][4];
    globali = 4;
    fn1();
    fn2(global);
    fn3(2, b,b);
}
Esempio n. 8
0
int
main (void)
{
  if (fn1 (__INT_MAX__ + 1U) != INT_MIN
      || fn2 (__LONG_MAX__ + 1UL) != LONG_MIN
      || fn3 (__LONG_LONG_MAX__ + 1ULL) != LLONG_MIN)
    __builtin_abort ();
}
Esempio n. 9
0
static int
fn5 ()
{
  int *g = &c;
  fn3 ();
  fn2 (0, 0, g);
  return e;
}
Esempio n. 10
0
int tmain(T Arg) {
#pragma omp task if (true)
  fn1();
#pragma omp task if (false)
  fn2();
#pragma omp task if (Arg)
  fn3();
  return 0;
}
Esempio n. 11
0
void
fn2 ()
{
  if (a)
    {
      fn3 ();
      c = d;
    }
}
Esempio n. 12
0
void
fn2 (void)
{
  int e = fn3 ();
  char f = c + fn1 ()->s * 4;
  if (*b && f == e)
    a = *b;
  fn4 (b);
}
Esempio n. 13
0
static __attribute__((noinline)) void
fn4 (void)
{
  pthread_cleanup_push (clh, (void *) 5l);

  fn3 ();

  pthread_cleanup_pop (1);
}
Esempio n. 14
0
int tmain(T Arg) {
#pragma omp parallel if (true)
  fn1();
#pragma omp parallel if (false)
  fn2();
#pragma omp parallel if (parallel: Arg)
  fn3();
  return 0;
}
Esempio n. 15
0
int
main (void)
{
  fn1 ();
  fn2 ();
  fn3 ();
  fn4 ();
  fn5 ();
  return 0;
}
Esempio n. 16
0
int
main (void)
{
  fn1 (128);
  fn2 (128);
  fn3 (128);
  fn4 (128);
  fn5 (128, 127);
  fn5 (128, 128);
  fn6 (128);
  return 0;
}
Esempio n. 17
0
NO_INLINE int
do_test (void)
{
  /* Test BZ #18084.  */
  void *buffer[1];

  if (backtrace (buffer, 0) != 0)
    FAIL ();

  fn3 ();
  return ret;
}
Esempio n. 18
0
int
main ()
{
    int i;
    check_vect ();
    fn3 ();
    fn1 ();
    for (i = 0; i < N; i++)
        if (a[i] != i * 2 + 23 + (i % 37) + (i & 63)
                || b[i] != 17 + (i % 37)
                || c[i] != i * 4 + 80 + 4 * (i % 37) + 4 * (i & 63))
            abort ();
    fn3 ();
    fn2 ();
    for (i = 0; i < N; i++)
        if (a[i] != i * 2 + 23 + (i % 37) + (i & 63)
                || b[i] != 17 + (i % 37)
                || c[i] != i * 4 + 80 + 4 * (i % 37) + 4 * (i & 63)
                || d[i] != ((unsigned char) (17 + i)) / 2)
            abort ();
    return 0;
}
Esempio n. 19
0
bool
FTjackSupport::m_fn1 ()
{
  if (!_jackClient)
    return 0;
  for (int i=0; _activePathCount; ++i)
    if (m_fn2 (i))
      fn2 (a);
  if (m_fn3 ())
    fn2 (a);
  if (fn3 (_jackClient))
    fn1 (0);
}
Esempio n. 20
0
static __inline__ __attribute__ ((always_inline)) void
fn1 (unsigned char arg0, unsigned char arg1, unsigned char arg2,
     unsigned char arg3, unsigned char arg4, unsigned char arg5,
     unsigned short arg6)
{
  asm volatile ("" :: "g" ((unsigned long long) arg0), "g" (arg1),
		      "g" (arg2), "g" (arg3), "g" (arg4), "g" (arg5),
		      "g" (arg6));
  if (cond)
    {
      unsigned char loc0 = 0;
      fn3 (loc0, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
    }
}
Esempio n. 21
0
int
main ()
{
  int ovf;
  if (fn1 (-10, __INT_MAX__) != (int) (-10U - __INT_MAX__)
      || fn2 (0, 0) != 0
      || fn2 (32, 16383) != (short int) 524256ULL)
    __builtin_abort ();
#if __SIZEOF_INT__ > __SIZEOF_SHORT__ && __SIZEOF_INT__ > 1
  if (fn3 (__SCHAR_MAX__, (unsigned short) ~0, &ovf) != (int) (__SCHAR_MAX__ + (unsigned short) ~0)
      || ovf
      || fn3 (-__SCHAR_MAX__ - 1, 0, &ovf) != (int) (-__SCHAR_MAX__ - 1)
      || ovf)
    __builtin_abort ();
#endif
  if (fn4 (65535, 0, &ovf) != 65535L * -32768 || ovf)
    __builtin_abort ();
#if __SIZEOF_INT__ > 1
  if (fn5 (0, 0, &ovf) != (signed char) (__SCHAR_MAX__ / 4 * 5)
      || !ovf
      || fn5 (63, 3, &ovf) != (signed char) ((__SCHAR_MAX__ / 4 + 63) * 8)
      || !ovf)
    __builtin_abort ();
#endif
  if (fn6 (0, 0, &ovf) != (unsigned char) ~0 - 66
      || ovf
      || fn6 (63, 3, &ovf) != (unsigned char) ~0
      || ovf)
    __builtin_abort ();
  if (fn7 (0, 0, &ovf) != 0
      || !ovf
      || fn7 (63, 3, &ovf) != 18
      || !ovf)
    __builtin_abort ();
  return 0;
}
Esempio n. 22
0
void
foo (T x)
{
  int a, b, c, d, e;
  T f, g;
  S h;
  a = x->t2;
  fn1 (x->t1);
  h = bar (b);
  c = fn1 (e);
  d = fn3 ();
  f->t3 &= g->t3 |= fn2 (0, b, x->t1);
  fn2 (0, c, d);
  fn2 (0, e, 0);
}
Esempio n. 23
0
int tmain(T Arg) {
#pragma omp task if (task: true)
  fn1();
#pragma omp task if (false)
  fn2();
#pragma omp task if (Arg)
  fn3();
#pragma omp task if (task: Arg) depend(in : Arg)
  fn4();
#pragma omp task if (Arg) depend(out : Arg)
  fn5();
#pragma omp task if (Arg) depend(inout : Arg)
  fn6();
  return 0;
}
Esempio n. 24
0
static struct T
fn8 (struct T x, int y)
{
  struct S *u = fn10 ();
  int v = fn5 (&u->s1, &u->s2, 0);
  while (1)
    {
      if (p)
fn6 ();
      if (fn3 (x))
return fn4 ();
      if (y & 1)
return r;
      v = fn5 (&u->s1, &u->s2, 1);
    }
}
Esempio n. 25
0
void fn4(void)
{
	for (;;) {
restart:
		for (b = 0;; b++) {
			int bla = fn1(1 && b);
			int g = fn2(e, 2);
			c =  bla > b;
			d |= g != 2;
			fn3();
			if (d)
				break;
		}
	}
	goto restart;
}
Esempio n. 26
0
void
fn4 ()
{
  __m128 f;
  fn3 (&c, &b);
  __m128 g = fn2 (1.f / b);
  e = (__m128){};
  __m128 h = e;
  for (int i = 0; i < 2 * c.width; i++)
    {
      for (; c.width;)
	f = a;
      h = f;
    }
  d = h * g;
}
Esempio n. 27
0
void FileNameTestCase::TestIsSame()
{
    wxFileName fn1( wxFileName::CreateTempFileName( "filenametest1" ) );
    CPPUNIT_ASSERT( fn1.IsOk() );
    wxON_BLOCK_EXIT1( wxRemoveFile, fn1.GetFullPath() );

    wxFileName fn2( wxFileName::CreateTempFileName( "filenametest2" ) );
    CPPUNIT_ASSERT( fn2.IsOk() );
    wxON_BLOCK_EXIT1( wxRemoveFile, fn2.GetFullPath() );

    CPPUNIT_ASSERT( fn1.SameAs( fn1 ) );
    CPPUNIT_ASSERT( !fn1.SameAs( fn2 ) );

#if defined(__UNIX__)
    // We need to create a temporary directory and a temporary link.
    // Unfortunately we can't use wxFileName::CreateTempFileName() for neither
    // as it creates plain files, so use tempnam() explicitly instead.
    char* tn = tempnam(NULL, "wxfn1");
    const wxString tempdir1 = wxString::From8BitData(tn);
    free(tn);

    CPPUNIT_ASSERT( wxFileName::Mkdir(tempdir1) );
    // Unfortunately the casts are needed to select the overload we need here.
    wxON_BLOCK_EXIT2( static_cast<bool (*)(const wxString&, int)>(wxFileName::Rmdir),
                      tempdir1, static_cast<int>(wxPATH_RMDIR_RECURSIVE) );

    tn = tempnam(NULL, "wxfn2");
    const wxString tempdir2 = wxString::From8BitData(tn);
    free(tn);
    CPPUNIT_ASSERT_EQUAL( 0, symlink(tempdir1.c_str(), tempdir2.c_str()) );
    wxON_BLOCK_EXIT1( wxRemoveFile, tempdir2 );


    wxFileName fn3(tempdir1, "foo");
    wxFileName fn4(tempdir2, "foo");

    // These files have different paths, hence are different.
    CPPUNIT_ASSERT( !fn3.SameAs(fn4) );

    // Create and close a file to trigger creating it.
    wxFile(fn3.GetFullPath(), wxFile::write);

    // Now that both files do exist we should be able to detect that they are
    // actually the same file.
    CPPUNIT_ASSERT( fn3.SameAs(fn4) );
#endif // __UNIX__
}
Esempio n. 28
0
void
test (void)
{
  a_t g;
  a_t *h, j;
  h = e;
  j = *h;
  if (e == (a_t *) 1) {
    a_t k = {fn3 (j)};
    fn4 (j);
    long l;
    g = foo((long long)b << 2 | l);
    k = g;
    if (j.a != k.a) {
      a_t m = g;
      int n = m.a, o = m.a >> 32;
      asm ("# %0 %1 %2 %3" : "=m"(*a), "+A"(f) : "b"(n), "c"(o));
    }
Esempio n. 29
0
void
fn1 (int p1, int p2)
{
  int o = a;
  for (; f; f++)
    {
      int p;
      if (e[h])
      continue;
      if (fn2 (o, d, l, n, p1, i, j, k, 0==0))
      continue;
      p = p2;
      if (b[g].escape)
      p++;
      fn3 ("", c, m);
      if (k)
      fn4 (p);
    }
}
Esempio n. 30
0
int main()
{
//    struct timeval tvBegin, tvEnd, tvDiff;

//    //without_openmp
//    gettimeofday(&tvBegin, NULL);
//    timeval_print(&tvBegin);
//    without_openmp();
//    gettimeofday(&tvEnd, NULL);
//    timeval_subtract(&tvDiff, &tvEnd, &tvBegin);
//    printf("without_openmp: %ld.%06ld\n", tvDiff.tv_sec, tvDiff.tv_usec);

//    //with_openmp
//    gettimeofday(&tvBegin, NULL);
//    timeval_print(&tvBegin);
//    with_openmp();
//    gettimeofday(&tvEnd, NULL);
//    timeval_subtract(&tvDiff, &tvEnd, &tvBegin);
//    printf("with_openmp: %ld.%06ld\n", tvDiff.tv_sec, tvDiff.tv_usec);


    int x[100],y,z,k;
    #pragma omp parallel shared(x,y,z) num_threads(2)
    {
        int tid= omp_get_thread_num();
        if(tid==0)
            {
                y = fn1(tid);
            }
        else
            {
                z = fn2(tid);
            }
        #pragma omp barrier
        #pragma omp for
        for (k=0; k<100; k++)
            {
                x[k] = y+z+fn3(k)+fn4(k);
            }
    }
    return 0;
}