From: Aldy Hernandez Date: Fri, 9 Oct 2020 07:31:47 +0000 (+0200) Subject: Move pr97315-1.c test to g++.dg/opt/. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6887244269e0c412afd43474e13fa5ca12c350c4;p=gcc.git Move pr97315-1.c test to g++.dg/opt/. gcc/testsuite/ChangeLog: PR testsuite/97337 * gcc.dg/pr97315-1.c: Moved to... * g++.dg/opt/pr97315-1.C: ...here. --- diff --git a/gcc/testsuite/g++.dg/opt/pr97315-1.C b/gcc/testsuite/g++.dg/opt/pr97315-1.C new file mode 100644 index 00000000000..5a618d8e1e8 --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr97315-1.C @@ -0,0 +1,27 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -fno-exceptions" } */ + +typedef struct tree_node *tree; +enum tree_code { RECORD_TYPE, QUAL_UNION_TYPE }; +enum tree_code_class {}; +struct tree_base { + tree_code code : 16; +}; +struct tree_node { + tree_base base; +}; +extern tree_code_class tree_code_type[]; +void tree_check_failed() __attribute__((__noreturn__)); +tree tree_check3(tree __t, tree_code __c1, tree_code __c3) { + if (__t->base.code != __c1 && __t->base.code != __c3) + tree_check_failed(); + return __t; +} +tree add_type_duplicate_type; +void add_type_duplicate() { + if (tree_code_type[add_type_duplicate_type->base.code]) + if (add_type_duplicate_type->base.code == RECORD_TYPE) + for (; + tree_check3(add_type_duplicate_type, RECORD_TYPE, QUAL_UNION_TYPE);) + tree_check3(add_type_duplicate_type, RECORD_TYPE, QUAL_UNION_TYPE); +} diff --git a/gcc/testsuite/gcc.dg/pr97315-1.c b/gcc/testsuite/gcc.dg/pr97315-1.c deleted file mode 100644 index 250e0e9ecbb..00000000000 --- a/gcc/testsuite/gcc.dg/pr97315-1.c +++ /dev/null @@ -1,27 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-O3" } */ - -typedef struct tree_node *tree; -enum tree_code { RECORD_TYPE, QUAL_UNION_TYPE }; -enum tree_code_class {}; -struct tree_base { - tree_code code : 16; -}; -struct tree_node { - tree_base base; -}; -extern tree_code_class tree_code_type[]; -void tree_check_failed() __attribute__((__noreturn__)); -tree tree_check3(tree __t, tree_code __c1, tree_code __c3) { - if (__t->base.code != __c1 && __t->base.code != __c3) - tree_check_failed(); - return __t; -} -tree add_type_duplicate_type; -void add_type_duplicate() { - if (tree_code_type[add_type_duplicate_type->base.code]) - if (add_type_duplicate_type->base.code == RECORD_TYPE) - for (; - tree_check3(add_type_duplicate_type, RECORD_TYPE, QUAL_UNION_TYPE);) - tree_check3(add_type_duplicate_type, RECORD_TYPE, QUAL_UNION_TYPE); -}