summaryrefslogtreecommitdiffstats
path: root/test/Sema/attr-unavailable-message.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/attr-unavailable-message.c')
-rw-r--r--test/Sema/attr-unavailable-message.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/Sema/attr-unavailable-message.c b/test/Sema/attr-unavailable-message.c
index 9710496..ebdf945 100644
--- a/test/Sema/attr-unavailable-message.c
+++ b/test/Sema/attr-unavailable-message.c
@@ -6,6 +6,11 @@ double dfoo(double) __attribute__((__unavailable__("NO LONGER"))); // expected-
void bar() __attribute__((__unavailable__)); // expected-note {{explicitly marked unavailable}}
+int quux(void) __attribute__((__unavailable__(12))); // expected-error {{'__unavailable__' attribute requires a string}}
+
+#define ACCEPTABLE "Use something else"
+int quux2(void) __attribute__((__unavailable__(ACCEPTABLE)));
+
void test_foo() {
int ir = foo(1); // expected-error {{'foo' is unavailable: USE IFOO INSTEAD}}
double dr = dfoo(1.0); // expected-error {{'dfoo' is unavailable: NO LONGER}}
@@ -32,13 +37,13 @@ enum foo {
a = 1, // expected-note {{declared here}}
b __attribute__((deprecated())) = 2, // expected-note {{declared here}}
c = 3
-}__attribute__((deprecated()));
+}__attribute__((deprecated()));
enum fee { // expected-note {{declaration has been explicitly marked unavailable here}}
r = 1, // expected-note {{declaration has been explicitly marked unavailable here}}
s = 2,
t = 3
-}__attribute__((unavailable()));
+}__attribute__((unavailable()));
enum fee f() { // expected-error {{'fee' is unavailable}}
int i = a; // expected-warning {{'a' is deprecated}}
OpenPOWER on IntegriCloud