1 /* Based on PR 67328 */ 2 3 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */ 4 /* { dg-options "-O2" } */ 5 6 enum output_type 7 { 8 type_pde, 9 type_relocatable, 10 type_pie, 11 type_dll, 12 }; 13 14 struct bfd_link_info 15 { 16 enum output_type type : 2; 17 unsigned int pad : 30; 18 }; 19 20 #define bfd_link_pde(info) ((info)->type == type_pde) 21 #define bfd_link_dll(info) ((info)->type == type_dll) 22 #define bfd_link_relocatable(info) ((info)->type == type_relocatable) 23 #define bfd_link_pie(info) ((info)->type == type_pie) 24 #define bfd_link_executable(info) (bfd_link_pde (info) || bfd_link_pie (info)) 25 #define bfd_link_pic(info) (bfd_link_dll (info) || bfd_link_pie (info)) 26 27 int result; 28 test_pic(struct bfd_link_info * info)29void test_pic (struct bfd_link_info *info) 30 { 31 if (bfd_link_pic (info)) 32 result++; 33 } 34 test_exe(struct bfd_link_info * info)35int test_exe (struct bfd_link_info *info) 36 { 37 if (bfd_link_executable (info)) 38 result++; 39 40 return 0; 41 } 42 43 /* { dg-final { scan-assembler-times "testn?b" 2 } } */ 44 45