diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-02-04 07:23:21 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-02-04 07:23:21 +0000 |
commit | 631a90b6bc1d8526d463660934dedf21c1904e5f (patch) | |
tree | 25419238e391a33944531d075c189ceac4e153d5 /clang/test/SemaObjC | |
parent | a3d95342485530eff535e880fbd94673cf3d62e9 (diff) | |
download | bcm5719-llvm-631a90b6bc1d8526d463660934dedf21c1904e5f.tar.gz bcm5719-llvm-631a90b6bc1d8526d463660934dedf21c1904e5f.zip |
Sema: Add support for __declspec(restrict)
__declspec(restrict) and __attribute(malloc) are both handled
identically by clang: they are allowed to the noalias LLVM attribute.
Seeing as how noalias models the C99 notion of 'restrict', rename the
internal clang attribute to Restrict from Malloc.
llvm-svn: 228120
Diffstat (limited to 'clang/test/SemaObjC')
-rw-r--r-- | clang/test/SemaObjC/attr-malloc.m | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/test/SemaObjC/attr-malloc.m b/clang/test/SemaObjC/attr-malloc.m index a504b333b51..0874a476806 100644 --- a/clang/test/SemaObjC/attr-malloc.m +++ b/clang/test/SemaObjC/attr-malloc.m @@ -1,8 +1,8 @@ // RUN: %clang_cc1 -verify -fsyntax-only -fblocks %s @interface TestAttrMallocOnMethods {} -- (id) test1 __attribute((malloc)); // expected-warning {{functions returning a pointer type}} -- (int) test2 __attribute((malloc)); // expected-warning {{functions returning a pointer type}} +- (id) test1 __attribute((malloc)); // expected-warning {{attribute only applies to functions}} +- (int) test2 __attribute((malloc)); // expected-warning {{attribute only applies to functions}} @end id bar(void) __attribute((malloc)); // no-warning @@ -10,7 +10,7 @@ id bar(void) __attribute((malloc)); // no-warning typedef void (^bptr)(void); bptr baz(void) __attribute((malloc)); // no-warning -__attribute((malloc)) id (*f)(); // expected-warning {{functions returning a pointer type}} -__attribute((malloc)) bptr (*g)(); // expected-warning {{functions returning a pointer type}} -__attribute((malloc)) void *(^h)(); // expected-warning {{functions returning a pointer type}} +__attribute((malloc)) id (*f)(); // expected-warning {{attribute only applies to functions}} +__attribute((malloc)) bptr (*g)(); // expected-warning {{attribute only applies to functions}} +__attribute((malloc)) void *(^h)(); // expected-warning {{attribute only applies to functions}} |