view gcc/testsuite/g++.dg/opt/pr79085.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 84e7813d76e9
children
line wrap: on
line source

// PR c++/79085
// { dg-do compile }
// { dg-options "-Os" }
// { dg-additional-options "-mstrict-align" { target { aarch64*-*-* powerpc*-*-linux* powerpc*-*-elf* } } }

void *operator new (__SIZE_TYPE__, void *p) { return p; }

struct S
{
  S ();
  S (const S &);
  ~S (void);
  int i;
};

S foo ();

static char buf [sizeof (S) + 1];

S *
bar ()
{
  return new (buf + 1) S (foo ());
}