1f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify %s 2f4a2713aSLionel Sambuc 3f4a2713aSLionel Sambuc #define NO_SANITIZE_THREAD __attribute__((no_sanitize_thread)) 4f4a2713aSLionel Sambuc 5f4a2713aSLionel Sambuc #if !__has_attribute(no_sanitize_thread) 6f4a2713aSLionel Sambuc #error "Should support no_sanitize_thread" 7f4a2713aSLionel Sambuc #endif 8f4a2713aSLionel Sambuc 9f4a2713aSLionel Sambuc void noanal_fun() NO_SANITIZE_THREAD; 10f4a2713aSLionel Sambuc 11f4a2713aSLionel Sambuc void noanal_fun_args() __attribute__((no_sanitize_thread(1))); // \ 12f4a2713aSLionel Sambuc // expected-error {{'no_sanitize_thread' attribute takes no arguments}} 13f4a2713aSLionel Sambuc 14f4a2713aSLionel Sambuc int noanal_testfn(int y) NO_SANITIZE_THREAD; 15f4a2713aSLionel Sambuc noanal_testfn(int y)16f4a2713aSLionel Sambucint noanal_testfn(int y) { 17f4a2713aSLionel Sambuc int x NO_SANITIZE_THREAD = y; // \ 18*0a6a1f1dSLionel Sambuc // expected-error {{'no_sanitize_thread' attribute only applies to functions}} 19f4a2713aSLionel Sambuc return x; 20f4a2713aSLionel Sambuc } 21f4a2713aSLionel Sambuc 22f4a2713aSLionel Sambuc int noanal_test_var NO_SANITIZE_THREAD; // \ 23*0a6a1f1dSLionel Sambuc // expected-error {{'no_sanitize_thread' attribute only applies to functions}} 24f4a2713aSLionel Sambuc 25f4a2713aSLionel Sambuc class NoanalFoo { 26f4a2713aSLionel Sambuc private: 27f4a2713aSLionel Sambuc int test_field NO_SANITIZE_THREAD; // \ 28*0a6a1f1dSLionel Sambuc // expected-error {{'no_sanitize_thread' attribute only applies to functions}} 29f4a2713aSLionel Sambuc void test_method() NO_SANITIZE_THREAD; 30f4a2713aSLionel Sambuc }; 31f4a2713aSLionel Sambuc 32f4a2713aSLionel Sambuc class NO_SANITIZE_THREAD NoanalTestClass { // \ 33*0a6a1f1dSLionel Sambuc // expected-error {{'no_sanitize_thread' attribute only applies to functions}} 34f4a2713aSLionel Sambuc }; 35f4a2713aSLionel Sambuc 36f4a2713aSLionel Sambuc void noanal_fun_params(int lvar NO_SANITIZE_THREAD); // \ 37*0a6a1f1dSLionel Sambuc // expected-error {{'no_sanitize_thread' attribute only applies to functions}} 38