OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [optimize3.C] - Blame information for rev 749

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
// { dg-options "-O2" }
3
//
4
// Copyright (C) 2001 Free Software Foundation, Inc.
5
// Contributed by Nathan Sidwell 29 May 2001 
6
 
7
// Bug 2936. We ICE'd on tree inlining a function with an anonymous
8
// union decl.
9
 
10
inline const unsigned char *Foo (const char *string)
11
{
12
  union
13
  {
14
    const char *p1;
15
    const unsigned char *p2;
16
  };
17
  p1 = 0;
18
  p2 = 0;
19
 
20
 
21
  p1 = string;
22
  return p2;
23
 
24
}
25
 
26
const unsigned char *Baz (const char *string)
27
{
28
  return Foo (string);
29
}
30
 
31
int main ()
32
{
33
  const char *string = "s";
34
  const unsigned char *result;
35
 
36
  result = Baz (string);
37
  return (static_cast  (result)
38
          != static_cast  (string));
39
}

powered by: WebSVN 2.1.0

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