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