llvm-for-llvmta/tools/clang/test/Sema/implicit-int-conversion.c

16 lines
566 B
C
Raw Normal View History

2022-04-25 13:02:35 +02:00
// RUN: %clang_cc1 %s -verify -Wconversion -Wno-implicit-int-conversion -DSMALL=char -DBIG=int -DNO_DIAG
// RUN: %clang_cc1 %s -verify -Wno-conversion -Wimplicit-int-conversion -DSMALL=char -DBIG=int
// RUN: %clang_cc1 %s -verify -Wconversion -Wno-implicit-float-conversion -DSMALL=float -DBIG=double -DNO_DIAG
// RUN: %clang_cc1 %s -verify -Wno-conversion -Wimplicit-float-conversion -DSMALL=float -DBIG=double
void f() {
SMALL a;
BIG b = 0;
a = b;
#ifndef NO_DIAG
// expected-warning@-2 {{implicit conversion}}
#else
// expected-no-diagnostics
#endif
}