2013-02-26 14:58:27 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
|
|
|
|
#define NO_SANITIZE_THREAD __attribute__((no_sanitize_thread))
|
|
|
|
|
|
|
|
#if !__has_attribute(no_sanitize_thread)
|
|
|
|
#error "Should support no_sanitize_thread"
|
|
|
|
#endif
|
2016-01-03 23:55:40 +08:00
|
|
|
|
|
|
|
void noanal_fun() NO_SANITIZE_THREAD;
|
|
|
|
|
|
|
|
void noanal_fun_alt() __attribute__((__no_sanitize_thread__));
|
|
|
|
|
|
|
|
void noanal_fun_args() __attribute__((no_sanitize_thread(1))); // \
|
|
|
|
// expected-error {{'no_sanitize_thread' attribute takes no arguments}}
|
|
|
|
|
2013-02-26 14:58:27 +08:00
|
|
|
int noanal_testfn(int y) NO_SANITIZE_THREAD;
|
|
|
|
|
|
|
|
int noanal_testfn(int y) {
|
|
|
|
int x NO_SANITIZE_THREAD = y; // \
|
2014-05-20 22:10:53 +08:00
|
|
|
// expected-error {{'no_sanitize_thread' attribute only applies to functions}}
|
2013-02-26 14:58:27 +08:00
|
|
|
return x;
|
|
|
|
}
|
|
|
|
|
|
|
|
int noanal_test_var NO_SANITIZE_THREAD; // \
|
2014-05-20 22:10:53 +08:00
|
|
|
// expected-error {{'no_sanitize_thread' attribute only applies to functions}}
|
2013-02-26 14:58:27 +08:00
|
|
|
|
|
|
|
class NoanalFoo {
|
|
|
|
private:
|
|
|
|
int test_field NO_SANITIZE_THREAD; // \
|
2014-05-20 22:10:53 +08:00
|
|
|
// expected-error {{'no_sanitize_thread' attribute only applies to functions}}
|
2013-02-26 14:58:27 +08:00
|
|
|
void test_method() NO_SANITIZE_THREAD;
|
|
|
|
};
|
|
|
|
|
|
|
|
class NO_SANITIZE_THREAD NoanalTestClass { // \
|
2014-05-20 22:10:53 +08:00
|
|
|
// expected-error {{'no_sanitize_thread' attribute only applies to functions}}
|
2013-02-26 14:58:27 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
void noanal_fun_params(int lvar NO_SANITIZE_THREAD); // \
|
2014-05-20 22:10:53 +08:00
|
|
|
// expected-error {{'no_sanitize_thread' attribute only applies to functions}}
|