repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fix test-suite fallout of default -Wreturn-type.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
ipa
/
ipa-icf-6.C
blob
d7650e4b502f896bd90c95b666a2b5e2643b6950
1
/* { dg-do run } */
2
/* { dg-options "-O3 -fdump-ipa-icf" } */
3
4
struct A {
5
A() {ptr=&b;}
6
A(const A &a) {ptr = &b;}
7
void test() { if (ptr != &b) __builtin_abort ();}
8
int b;
9
int *ptr;
10
};
11
12
A test1(A a)
13
{
14
a.test();
15
return a;
16
}
17
A test2(A a)
18
{
19
a.test();
20
return a;
21
}
22
__attribute__ ((noinline))
23
static void
24
test_me (A (*t)(A))
25
{
26
struct A a, b=t(a);
27
b.test ();
28
}
29
int
30
main()
31
{
32
test_me (test1);
33
test_me (test2);
34
return 0;
35
}
36
/* { dg-final { scan-ipa-dump-times "Unified; Wrapper has been created" 1 "icf" } } */