diff options
| author | Paul Robinson <paul_robinson@playstation.sony.com> | 2014-12-15 18:57:28 +0000 |
|---|---|---|
| committer | Paul Robinson <paul_robinson@playstation.sony.com> | 2014-12-15 18:57:28 +0000 |
| commit | 30e41fb4da688d9c7c4d9bc122d8f1cb9a864f75 (patch) | |
| tree | 0ee33016bac3c92c95642f9566df6abbba07e0d3 /clang/test | |
| parent | addddc441f9c7fbd4ed70bc5a3256c385599929d (diff) | |
| download | bcm5719-llvm-30e41fb4da688d9c7c4d9bc122d8f1cb9a864f75.tar.gz bcm5719-llvm-30e41fb4da688d9c7c4d9bc122d8f1cb9a864f75.zip | |
Warn when attribute 'optnone' conflicts with attributes on a
different declaration of the same function.
llvm-svn: 224256
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/SemaCXX/attr-optnone.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/attr-optnone.cpp b/clang/test/SemaCXX/attr-optnone.cpp index e2fce8e2394..89ef6c57953 100644 --- a/clang/test/SemaCXX/attr-optnone.cpp +++ b/clang/test/SemaCXX/attr-optnone.cpp @@ -6,9 +6,27 @@ int bar() __attribute__((optnone)) __attribute__((noinline)); int baz() __attribute__((always_inline)) __attribute__((optnone)); // expected-error{{'always_inline' and 'optnone' attributes are not compatible}} int quz() __attribute__((optnone)) __attribute__((always_inline)); // expected-error{{'optnone' and 'always_inline' attributes are not compatible}} +__attribute__((always_inline)) int baz1(); // expected-warning{{'always_inline' attribute ignored}} +__attribute__((optnone)) int baz1() { return 1; } // expected-note{{conflicting attribute is here}} + +__attribute__((optnone)) int quz1(); // expected-note{{conflicting attribute is here}} +__attribute__((always_inline)) int quz1() { return 1; } // expected-warning{{'always_inline' attribute ignored}} + int bay() __attribute__((minsize)) __attribute__((optnone)); // expected-error{{'minsize' and 'optnone' attributes are not compatible}} int quy() __attribute__((optnone)) __attribute__((minsize)); // expected-error{{'optnone' and 'minsize' attributes are not compatible}} +__attribute__((minsize)) int bay1(); // expected-warning{{'minsize' attribute ignored}} +__attribute__((optnone)) int bay1() { return 1; } // expected-note{{conflicting attribute is here}} + +__attribute__((optnone)) int quy1(); // expected-note{{conflicting attribute is here}} +__attribute__((minsize)) int quy1() { return 1; } // expected-warning{{'minsize' attribute ignored}} + +__attribute__((always_inline)) // expected-warning{{'always_inline' attribute ignored}} + __attribute__((minsize)) // expected-warning{{'minsize' attribute ignored}} +void bay2(); +__attribute__((optnone)) // expected-note 2 {{conflicting}} +void bay2() {} + __forceinline __attribute__((optnone)) int bax(); // expected-error{{'__forceinline' and 'optnone' attributes are not compatible}} __attribute__((optnone)) __forceinline int qux(); // expected-error{{'optnone' and '__forceinline' attributes are not compatible}} |

