OSDN Git Service

2012-01-30 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / tree-ssa / inline-4.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-einline" } */
3 /* { dg-add-options bind_pic_locally } */
4
5 extern int rand(void);
6
7 int get_data_for (int id)
8 {
9   return rand();
10 }
11
12 int my_id;
13
14 int main()
15 {
16   int res = get_data_for (my_id);
17   switch (res)
18     {
19       case 0:
20           return 666;
21       default:
22           return -1;
23     }
24 }
25
26 /* { dg-final { scan-tree-dump "Inlining get_data_for into main" "einline" } } */
27 /* { dg-final { cleanup-tree-dump "einline" } } */