Esempio n. 1
0
void
c (void)
{
  __builtin_strcat (d, "12345");
  if (__builtin_strstr (b, d) == b)
    a ();
}
Esempio n. 2
0
void main_test (void)
{
  const char *const s1 = "hello world";
  const char *const s2 = "";
  char dst[64], *d2;
  
  RESET_DST_WITH (s1);
  if (strcat (dst, "") != dst || memcmp (dst, "hello world\0XXX", 15))
    abort();
  RESET_DST_WITH (s1);
  if (strcat (dst, s2) != dst || memcmp (dst, "hello world\0XXX", 15))
    abort();
  RESET_DST_WITH (s1); d2 = dst;
  if (strcat (++d2, s2) != dst+1 || d2 != dst+1
      || memcmp (dst, "hello world\0XXX", 15))
    abort();
  RESET_DST_WITH (s1); d2 = dst;
  if (strcat (++d2+5, s2) != dst+6 || d2 != dst+1
      || memcmp (dst, "hello world\0XXX", 15))
    abort();
  RESET_DST_WITH (s1); d2 = dst;
  if (strcat (++d2+5, s1+11) != dst+6 || d2 != dst+1
      || memcmp (dst, "hello world\0XXX", 15))
    abort();

#ifndef __OPTIMIZE_SIZE__

  RESET_DST_WITH (s1);
  if (strcat (dst, " 1111") != dst
      || memcmp (dst, "hello world 1111\0XXX", 20))
    abort();
  
  RESET_DST_WITH (s1);
  if (strcat (dst+5, " 2222") != dst+5
      || memcmp (dst, "hello world 2222\0XXX", 20))
    abort();
  
  RESET_DST_WITH (s1); d2 = dst;
  if (strcat (++d2+5, " 3333") != dst+6 || d2 != dst+1
      || memcmp (dst, "hello world 3333\0XXX", 20))
    abort();
  
  RESET_DST_WITH (s1);
  strcat (strcat (strcat (strcat (strcat (strcat (dst, ": this "), ""),
				  "is "), "a "), "test"), ".");
  if (memcmp (dst, "hello world: this is a test.\0X", 30))
    abort();

#endif

  /* Test at least one instance of the __builtin_ style.  We do this
     to ensure that it works and that the prototype is correct.  */
  RESET_DST_WITH (s1);
  if (__builtin_strcat (dst, "") != dst || memcmp (dst, "hello world\0XXX", 15))
    abort();
}
Esempio n. 3
0
void f(void *d, const void *s, __SIZE_TYPE__ n)
{
  void *t1 = __builtin_memcpy (d, s, n);
  if (t1 == 0)
    __builtin_abort ();

  void *t2 = __builtin_memmove (d, s, n);
  if (t2 == 0)
    __builtin_abort ();

  void *t3 = __builtin_memset (d, 0, n);
  if (t3 == 0)
    __builtin_abort ();

  void *t4 = __builtin_strcpy (d, s);
  if (t4 == 0)
    __builtin_abort ();

  void *t5 = __builtin_strncpy (d, s, n);
  if (t5 == 0)
    __builtin_abort ();

  void *t6 = __builtin_strcat (d, s);
  if (t6 == 0)
    __builtin_abort ();

  void *t7 = __builtin_strncat (d, s, n);
  if (t7 == 0)
    __builtin_abort ();

  void *t8 = __builtin_stpcpy (d, s);
  if (t8 == 0)
    __builtin_abort ();

  void *t9 = __builtin_stpncpy (d, s, n);
  if (t9 == 0)
    __builtin_abort ();
}
Esempio n. 4
0
void foo() {
 __builtin_strcat(0, 0);
}
Esempio n. 5
0
void * sbrk ()
{
 volatile register unsigned int sp_r1 __asm__ ("ebx");
 return __builtin_strcat ((char*)sp_r1, 0); /* { dg-warning "cast to pointer from integer of different size" } */
}