OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [pubtypes-1.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile { target *-*-darwin* } } */
2
/* { dg-options "-O0 -gdwarf-2 -dA -fno-eliminate-unused-debug-types" } */
3
/* { dg-skip-if "Unmatchable assembly" { mmix-*-* } { "*" } { "" } } */
4
/* { dg-final { scan-assembler "__debug_pubtypes" } } */
5
/* { dg-final { scan-assembler "long+\[ \t\]+0x\[0-9a-f]+\[ \t\]+\[#;]+\[ \t\]+Length of Public Type Names Info" } } */
6
/* { dg-final { scan-assembler "used_struct\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
7
/* { dg-final { scan-assembler "unused_struct\\\\0\"+\[ \t\]+\[#;]+\[ \t\]+external name" } } */
8
 
9
 
10
#include <stdlib.h>
11
#include <stdio.h>
12
 
13
struct used_struct
14
{
15
  int key;
16
  char *name;
17
};
18
 
19
struct unused_struct
20
{
21
  int key1;
22
  int f2;
23
  double f3;
24
  char *f4;
25
  struct unused_struct *next;
26
};
27
 
28
int
29
main (int argc, char **argv)
30
{
31
  int i;
32
  struct used_struct *my_list;
33
 
34
  my_list = (struct used_struct *) malloc (10 * sizeof (struct used_struct));
35
 
36
  for (i = 0; i < 10; i++)
37
    {
38
      my_list[i].key = i;
39
      my_list[i].name = (char *) malloc (11);
40
      sprintf (my_list[i].name, "Alice_%d", i);
41
    }
42
 
43
  for (i = 0; i < 10; i++)
44
    fprintf (stdout, "Key: %d, Name: %s\n", my_list[i].key, my_list[i].name);
45
 
46
  return 0;
47
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.