summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/ipa/ipa-ea-13-calling-printf-0.c
blob: fb3e0e9d17d10f73595e4e3c8ce5a24a3fd89915 (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
26
27
/* { dg-do link } */
/* { dg-options  "-flto -fipa-type-escape-analysis -fdump-ipa-type-escape-analysis -fprint-escape-analysis" } */

#include <stddef.h>
#include <stdio.h>

int main(int argc, char** argv)
{
	char *filename = "helloworld.txt";
	FILE* f = fopen(filename, "r");
	fclose(f);
}


// This is the incomplete type p=0 because it is memoized and it is an optimization.
// However, I will also match a 1
/* { dg-final { scan-wpa-ipa-dump " record _IO_FILE .. reason: g=0 p=. r=1 c=0 v=0 u=0" "type-escape-analysis" } } */
/* { dg-final { scan-wpa-ipa-dump " record _IO_FILE ... reason: g=0 p=. r=1 c=0 v=0 u=0" "type-escape-analysis" } } */
/* { dg-final { scan-wpa-ipa-dump " record _IO_wide_data .. reason: g=0 p=. r=1 c=0 v=0 u=0" "type-escape-analysis" } } */
/* { dg-final { scan-wpa-ipa-dump " record _IO_wide_data ... reason: g=0 p=. r=1 c=0 v=0 u=0" "type-escape-analysis" } } */
/* { dg-final { scan-wpa-ipa-dump " record _IO_codecvt .. reason: g=0 p=. r=1 c=0 v=0 u=0" "type-escape-analysis" } } */
/* { dg-final { scan-wpa-ipa-dump " record _IO_codecvt ... reason: g=0 p=. r=1 c=0 v=0 u=0" "type-escape-analysis" } } */
/* { dg-final { scan-wpa-ipa-dump "void_type. reason: g=0 p=. r=1 c=0 v=0 u=0" "type-escape-analysis" } } */
/* { dg-final { scan-wpa-ipa-dump " record _IO_marker .. reason: g=0 p=. r=1 c=0 v=0 u=0" "type-escape-analysis" } } */
/* { dg-final { scan-wpa-ipa-dump " record _IO_marker ... reason: g=0 p=. r=1 c=0 v=0 u=0" "type-escape-analysis" } } */
// This is the complete type... but I have condensed it to match .*
/* { dg-final { scan-wpa-ipa-dump "  record FILE .* reason: g=0 p=. r=1 c=0 v=0 u=0" "type-escape-analysis" } } */