Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / attr-no-sanitize-thread.cpp
blob7f97399e162941ab03c97912caac713b68e3435a
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 #define NO_SANITIZE_THREAD __attribute__((no_sanitize_thread))
5 #if !__has_attribute(no_sanitize_thread)
6 #error "Should support no_sanitize_thread"
7 #endif
9 void no_analyze_fun() NO_SANITIZE_THREAD;
11 void no_analyze_alt() __attribute__((__no_sanitize_thread__));
13 void no_analyze_args() __attribute__((no_sanitize_thread(1))); // \
14 // expected-error {{'no_sanitize_thread' attribute takes no arguments}}
16 int no_analyze_testfn(int y) NO_SANITIZE_THREAD;
18 int no_analyze_testfn(int y) {
19 int x NO_SANITIZE_THREAD = y; // \
20 // expected-error {{'no_sanitize_thread' attribute only applies to functions}}
21 return x;
24 int no_analyze_test_var NO_SANITIZE_THREAD; // \
25 // expected-error {{'no_sanitize_thread' attribute only applies to functions}}
27 class NoAnalyzeFoo {
28 private:
29 int test_field NO_SANITIZE_THREAD; // \
30 // expected-error {{'no_sanitize_thread' attribute only applies to functions}}
31 void test_method() NO_SANITIZE_THREAD;
34 class NO_SANITIZE_THREAD NoAnalyzeTestClass { // \
35 // expected-error {{'no_sanitize_thread' attribute only applies to functions}}
38 void no_analyze_params(int lvar NO_SANITIZE_THREAD); // \
39 // expected-error {{'no_sanitize_thread' attribute only applies to functions}}