view gcc/testsuite/c-c++-common/Wtautological-compare-8.c @ 19:2b5abeee2509 default tip

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

/* { dg-options "-Wtautological-compare" } */

int foo;
#define INCOMING_FRAME_SP_OFFSET foo
#define DEFAULT_INCOMING_FRAME_SP_OFFSET INCOMING_FRAME_SP_OFFSET

int test (void)
{
  if (DEFAULT_INCOMING_FRAME_SP_OFFSET != INCOMING_FRAME_SP_OFFSET) /* { dg-warning "self-comparison" "" { target c } } */
    return 1;
  else
    return 0;
}

#define BYTES_BIG_ENDIAN foo
#define WORDS_BIG_ENDIAN foo

int test_2 (void)
{
  if (BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN) /* { dg-warning "self-comparison" "" { target c } } */
    return 1;
  else
    return 0;
}

#define COND DEFAULT_INCOMING_FRAME_SP_OFFSET != INCOMING_FRAME_SP_OFFSET
int test_3 (void)
{
  if (COND)
    return 1;
  else
    return 0;
}