view gcc/testsuite/g++.dg/ext/alias-canon.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// PR c++/34935
/* { dg-do compile } */
/* { dg-final { scan-assembler "_Z1fi" } } */
/* { dg-final { scan-assembler "_Z1fb" } } */
/* { dg-final { scan-assembler "_Z1fd" } } */
/* { dg-final { scan-assembler "_Z1ff" } } */
/* { dg-final { scan-assembler "_Z1fw" } } */

typedef int INT __attribute((may_alias));

void f(int);
void f(INT) { }

typedef bool BOOL __attribute((may_alias));

void f(bool);
void f(BOOL) { }

typedef float FLOAT __attribute((may_alias));

void f(float);
void f(FLOAT) { }

typedef double DOUBLE __attribute((may_alias));

void f(double);
void f(DOUBLE) {}

typedef wchar_t WCHAR_T __attribute((may_alias));

void f(wchar_t);
void f(WCHAR_T) {}

void test()
{
  f(0);
  f(true);
  f(1.0f);
  f(1.0);
  f(L'f');
}