view gcc/testsuite/gcc.dg/guality/param-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* { dg-do run } */
/* { dg-options "-g" } */
/* { dg-skip-if "" { *-*-* }  { "*" } { "-O0" } } */

typedef __UINTPTR_TYPE__ uintptr_t;

__attribute__((noinline, noclone)) int
sub (int a, int b)
{
  return a - b;
}

typedef struct { uintptr_t pa; uintptr_t pb; } fatp_t
  __attribute__ ((aligned (2 * __alignof__ (uintptr_t))));

__attribute__((noinline, noclone)) void
foo (fatp_t str, int a, int b)
{
  int i = sub (a, b);
  if (i == 0)           /* BREAK */
    i = sub (b, a);
}

int
main (void)
{
  fatp_t ptr = { 31415927, 27182818 };
  foo (ptr, 1, 2);
  return 0;
}

/* { dg-final { gdb-test 20 "str.pa" "31415927" } } */
/* { dg-final { gdb-test 20 "str.pb" "27182818" } } */