summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/type-playground-03.c
blob: 4ffe949f826ac76a6ae1403fd1f4cc54ace629ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* { dg-do run } */
/* { dg-options  "-flto -fipa-escape-analysis -fdump-ipa-escape-analysis -ftp-comparison-functions=EQ_IDENTIFIER -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 {} = t,
//                                   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 .. = t," "escape-analysis" } } */