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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [stackalign/] [alloca-3.c] - Blame information for rev 424

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* PR middle-end/37009 */
2
/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
3
/* { dg-options "-msse2" } */
4
/* { dg-require-effective-target sse2 } */
5
/* { dg-require-effective-target sse2_runtime } */
6
 
7
#include <emmintrin.h>
8
#include "check.h"
9
 
10
#ifndef ALIGNMENT
11
#define ALIGNMENT       16
12
#endif
13
 
14
typedef int aligned __attribute__((aligned(ALIGNMENT)));
15
 
16
void
17
bar (char *p, int size)
18
{
19
  __builtin_strncpy (p, "good", size);
20
}
21
 
22
void
23
__attribute__ ((noinline))
24
foo (__m128 x, __m128 y ,__m128 z ,__m128 a, int size)
25
{
26
  char *p = __builtin_alloca (size + 1);
27
  aligned i;
28
 
29
  bar (p, size);
30
  if (__builtin_strncmp (p, "good", size) != 0)
31
    {
32
#ifdef DEBUG
33
      p[size] = '\0';
34
      printf ("Failed: %s != good\n", p);
35
#endif
36
      abort ();
37
    }
38
 
39
  if (check_int (&i,  __alignof__(i)) != i)
40
    abort ();
41
}
42
 
43
int
44
main (void)
45
{
46
  __m128 x = { 1.0 };
47
  foo (x, x, x, x, 5);
48
 
49
  return 0;
50
}

powered by: WebSVN 2.1.0

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