1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 #define NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
5 #if !__has_attribute(no_sanitize_address)
6 #error "Should support no_sanitize_address"
9 void no_analyze() NO_SANITIZE_ADDRESS
;
11 void no_analyze_alt() __attribute__((__no_sanitize_address__
));
13 void no_analyze_args() __attribute__((no_sanitize_address(1))); // \
14 // expected-error {{'no_sanitize_address' attribute takes no arguments}}
16 int no_analyze_testfn(int y
) NO_SANITIZE_ADDRESS
;
18 int no_analyze_testfn(int y
) {
19 int x NO_SANITIZE_ADDRESS
= y
; // \
20 // expected-error {{'no_sanitize_address' attribute only applies to functions}}
26 int test_field NO_SANITIZE_ADDRESS
; // \
27 // expected-error {{'no_sanitize_address' attribute only applies to functions}}
28 void test_method() NO_SANITIZE_ADDRESS
;
31 class NO_SANITIZE_ADDRESS NoAnalyzeTestClass
{ // \
32 // expected-error {{'no_sanitize_address' attribute only applies to functions}}
35 void no_analyze_params(int lvar NO_SANITIZE_ADDRESS
); // \
36 // expected-error {{'no_sanitize_address' attribute only applies to functions}}