view gcc/testsuite/c-c++-common/fold-masked-cmp-2.c @ 16:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
line wrap: on
line source

/* Based on PR 67328 */

/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
/* { dg-options "-O2" } */

enum output_type
{
  type_pde,
  type_relocatable,
  type_pie,
  type_dll,
};

struct bfd_link_info
{
  enum output_type type : 2;
  unsigned int pad : 30;
};

#define bfd_link_pde(info)	   ((info)->type == type_pde)
#define bfd_link_dll(info)	   ((info)->type == type_dll)
#define bfd_link_relocatable(info) ((info)->type == type_relocatable)
#define bfd_link_pie(info)	   ((info)->type == type_pie)
#define bfd_link_executable(info)  (bfd_link_pde (info) || bfd_link_pie (info))
#define bfd_link_pic(info)	   (bfd_link_dll (info) || bfd_link_pie (info))

int result;

void test_pic (struct bfd_link_info *info)
{
  if (bfd_link_pic (info))
    result++;
}

int test_exe (struct bfd_link_info *info)
{
  if (bfd_link_executable (info))
    result++;
}

/* { dg-final { scan-assembler-times "testn?b" 2 } } */