summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/type-playground-04.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/ipa/type-playground-04.c')
-rw-r--r--gcc/testsuite/gcc.dg/ipa/type-playground-04.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/type-playground-04.c b/gcc/testsuite/gcc.dg/ipa/type-playground-04.c
new file mode 100644
index 00000000000..7b490f6eca3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/type-playground-04.c
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+/* { dg-options "-flto -fipa-escape-analysis -fdump-ipa-escape-analysis -ftp-comparison-functions=EQ_CANONICAL -ftp-types-compared=astruct_s" } */
+
+struct astruct_s {
+ struct astruct_s* a;
+};
+
+int
+main(int argc, char* argv)
+{
+ struct astruct_s a;
+}
+
+// This is proof that an incomplete type **CAN** be compared
+// via identifier identity.
+// Intuitevely, identifier identity may give false positives (and maybe false negatives too?)
+// So, it must be the last resort comparisons.
+//
+// If we say that an identifier comparison may give false positives and false negatives
+// then maybe it would be useful to documents attempts to explicitly produce false positives
+// and false negatives to better understand what causes them.
+
+// 0,64:astruct_s {0,64:astruct_s {}*;} x 0,0:astruct_s {} = f,
+// I am not an expert on regex
+/* { dg-final { scan-wpa-ipa-dump "0,64:astruct_s .0,64:astruct_s ..... x 0,0:astruct_s .. = f," "escape-analysis" } } */