]> granicus.if.org Git - clang/commitdiff
An updated test to show the current warnings produced for implicit conversions from...
authorAndrew V. Tischenko <andrew.v.tischenko@gmail.com>
Tue, 13 Feb 2018 15:20:29 +0000 (15:20 +0000)
committerAndrew V. Tischenko <andrew.v.tischenko@gmail.com>
Tue, 13 Feb 2018 15:20:29 +0000 (15:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325011 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/conversion.c

index 89c34c6a224ccd3d8fecc797bef89700f0f8722b..e55e8344e293459d9e480f916ef586a29ea5626b 100644 (file)
@@ -429,3 +429,17 @@ void test27(ushort16 constants) {
     ushort16 crCbScale = pairedConstants.s4; // expected-warning {{implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to 'ushort16'}}
     ushort16 brBias = pairedConstants.s6; // expected-warning {{implicit conversion loses integer precision: 'uint32_t' (aka 'unsigned int') to 'ushort16'}}
 }
+
+
+float double2float_test1(double a) {
+    return a; // expected-warning {{implicit conversion loses floating-point precision: 'double' to 'float'}}
+}
+
+void double2float_test2(double a, float *b) {
+    *b += a;
+}
+
+float sinf (float x);
+double double2float_test3(double a) {
+    return sinf(a); // expected-warning {{implicit conversion loses floating-point precision: 'double' to 'float'}}
+}