2010-11-10 06:22:12 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-apple-darwin %s
|
|
|
|
|
|
|
|
// This file tests -Wconstant-conversion, a subcategory of -Wconversion
|
|
|
|
// which is on by default.
|
|
|
|
|
|
|
|
// rdar://problem/6792488
|
|
|
|
void test_6792488(void) {
|
|
|
|
int x = 0x3ff0000000000000U; // expected-warning {{implicit conversion from 'unsigned long' to 'int' changes value from 4607182418800017408 to 0}}
|
|
|
|
}
|
2010-11-10 07:24:47 +08:00
|
|
|
|
|
|
|
void test_7809123(void) {
|
|
|
|
struct { int i5 : 5; } a;
|
|
|
|
|
2010-11-10 07:36:43 +08:00
|
|
|
a.i5 = 36; // expected-warning {{implicit truncation from 'int' to bitfield changes value from 36 to 4}}
|
2010-11-10 07:24:47 +08:00
|
|
|
}
|