summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c b/gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c
new file mode 100644
index 000000000..0eff197bf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/foldconst-2.c
@@ -0,0 +1,58 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-ch" } */
+typedef union tree_node *tree;
+enum tree_code
+{
+ OFFSET_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, POINTER_TYPE, FIXED_POINT_TYPE,
+};
+struct tree_base
+{
+ unsigned public_flag:1;
+};
+struct tree_decl_with_vis
+{
+ unsigned comdat_flag:1;
+};
+union tree_node
+{
+ struct tree_base base;
+ struct tree_decl_with_vis decl_with_vis;
+};
+enum tree_index
+{
+ TI_LONG_DOUBLE_PTR_TYPE, TI_INTEGER_PTR_TYPE, TI_VOID_TYPE, TI_PTR_TYPE,
+ TI_VA_LIST_FPR_COUNTER_FIELD, TI_BOOLEAN_TYPE, TI_FILEPTR_TYPE,
+ TI_CURRENT_TARGET_PRAGMA, TI_CURRENT_OPTIMIZE_PRAGMA, TI_MAX
+};
+extern tree global_trees[TI_MAX];
+emit_support_tinfos (void)
+{
+ static tree *const fundamentals[] = {
+ &global_trees[TI_VOID_TYPE], &global_trees[TI_BOOLEAN_TYPE],
+ };
+ int ix;
+ for (ix = 0; fundamentals[ix]; ix++)
+ {
+ {
+ tree tinfo;
+ {
+ ((void) (!(((tinfo)->base.public_flag) && !(__extension__ (
+ {
+ __typeof
+ (tinfo)
+ __t
+ =
+ (tinfo);
+ __t;}
+ )->decl_with_vis.
+ comdat_flag)) ?
+ fancy_abort ("../../gcc/cp/rtti.c", 1529,
+ __FUNCTION__), 0 : 0));
+ }
+ }
+ }
+}
+/* We should copy loop header to fundamentals[0] and then fold it way into
+ known value. */
+/* { dg-final { scan-tree-dump-not "fundamentals.0" "ch"} } */
+/* { dg-final { cleanup-tree-dump "ch" } } */