]> granicus.if.org Git - clang/commitdiff
testcase for previous patch!
authorChris Lattner <sabre@nondot.org>
Wed, 30 Dec 2009 22:10:22 +0000 (22:10 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 30 Dec 2009 22:10:22 +0000 (22:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92317 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/builtins.c
test/Sema/unused-expr.c

index a23273740c789a520623e6e0b4b0616b5b522f60..7b2f2afbd9cad5289b8402e15de791d8d04fcef5 100644 (file)
@@ -25,10 +25,11 @@ int test6(float a, long double b) {
 
 #define CFSTR __builtin___CFStringMakeConstantString
 void test7() {
-  CFSTR("\242");
-  CFSTR("\0"); // expected-warning {{ CFString literal contains NUL character }}
-  CFSTR(242); // expected-error {{ CFString literal is not a string constant }} expected-warning {{incompatible integer to pointer conversion}}
-  CFSTR("foo", "bar"); // expected-error {{too many arguments to function call}}
+  const void *X;
+  X = CFSTR("\242");
+  X = CFSTR("\0"); // expected-warning {{ CFString literal contains NUL character }}
+  X = CFSTR(242); // expected-error {{ CFString literal is not a string constant }} expected-warning {{incompatible integer to pointer conversion}}
+  X = CFSTR("foo", "bar"); // expected-error {{too many arguments to function call}}
 }
 
 
index 30f6aee26b408db129219f866f02006de206406d..f5c64e6715cd0df7b197e84c9fa9bed8a509a2d3 100644 (file)
@@ -91,6 +91,7 @@ int t6() {
   fn1();  // expected-warning {{ignoring return value of function declared with warn_unused_result attribute}}
   fn2(92, 21);  // expected-warning {{ignoring return value of function declared with pure attribute}}
   fn3(42);  // expected-warning {{ignoring return value of function declared with const attribute}}
+  __builtin_fabsf(0); // expected-warning {{ignoring return value of function declared with const attribute}}
   return 0;
 }