xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/annotate.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -fsyntax-only -verify
2*f4a2713aSLionel Sambuc 
foo(float * a)3*f4a2713aSLionel Sambuc void __attribute__((annotate("foo"))) foo(float *a) {
4*f4a2713aSLionel Sambuc   __attribute__((annotate("bar"))) int x;
5*f4a2713aSLionel Sambuc   __attribute__((annotate(1))) int y; // expected-error {{'annotate' attribute requires a string}}
6*f4a2713aSLionel Sambuc   __attribute__((annotate("bar", 1))) int z; // expected-error {{'annotate' attribute takes one argument}}
7*f4a2713aSLionel Sambuc   int u = __builtin_annotation(z, (char*) 0); // expected-error {{second argument to __builtin_annotation must be a non-wide string constant}}
8*f4a2713aSLionel Sambuc   int v = __builtin_annotation(z, (char*) L"bar"); // expected-error {{second argument to __builtin_annotation must be a non-wide string constant}}
9*f4a2713aSLionel Sambuc   int w = __builtin_annotation(z, "foo");
10*f4a2713aSLionel Sambuc   float b = __builtin_annotation(*a, "foo"); // expected-error {{first argument to __builtin_annotation must be an integer}}
11*f4a2713aSLionel Sambuc }
12