summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/type-playground-00.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/ipa/type-playground-00.c')
-rw-r--r--gcc/testsuite/gcc.dg/ipa/type-playground-00.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/type-playground-00.c b/gcc/testsuite/gcc.dg/ipa/type-playground-00.c
new file mode 100644
index 00000000000..6bddfac9939
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/type-playground-00.c
@@ -0,0 +1,21 @@
+/* { dg-do link } */
+/* { dg-options "-flto -fipa-escape-analysis -fdump-ipa-escape-analysis -ftp-comparison-functions=EQ_POINTER -ftp-types-compared=int " } */
+
+int
+main ()
+{
+ int a = 0;
+ const int b = 0;
+ return 0;
+}
+
+// This is proof that comparing trees using only
+// pointer equality yields different trees
+// when types have different attributes.
+// i.e.
+// TREE_TYPE(a) == TREE_TYPE(b)
+// evaluates to false
+
+
+/* { dg-final { scan-wpa-ipa-dump "0,32:integer_type x 0,32:integer_type = t," "escape-analysis" } } */
+