summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-30 22:10:22 +0000
committerChris Lattner <sabre@nondot.org>2009-12-30 22:10:22 +0000
commitd866c5a6786dffaf5000ff04777f4fbfd79997a5 (patch)
tree610d3402f31f5e97bc3c375d62b5fde72142e252 /clang/test
parent8977c433d3378b59a7b558f148719ce68d169360 (diff)
downloadbcm5719-llvm-d866c5a6786dffaf5000ff04777f4fbfd79997a5.tar.gz
bcm5719-llvm-d866c5a6786dffaf5000ff04777f4fbfd79997a5.zip
testcase for previous patch!
llvm-svn: 92317
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/builtins.c9
-rw-r--r--clang/test/Sema/unused-expr.c1
2 files changed, 6 insertions, 4 deletions
diff --git a/clang/test/Sema/builtins.c b/clang/test/Sema/builtins.c
index a23273740c7..7b2f2afbd9c 100644
--- a/clang/test/Sema/builtins.c
+++ b/clang/test/Sema/builtins.c
@@ -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}}
}
diff --git a/clang/test/Sema/unused-expr.c b/clang/test/Sema/unused-expr.c
index 30f6aee26b4..f5c64e6715c 100644
--- a/clang/test/Sema/unused-expr.c
+++ b/clang/test/Sema/unused-expr.c
@@ -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;
}
OpenPOWER on IntegriCloud