From: David Blaikie Date: Tue, 21 Jan 2014 19:07:40 +0000 (+0000) Subject: Correct the function name shown in diagnostics in warn-thread-safety-analysis.c X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=045c4ee44da98578218b0cf16d5667a68c71f18b;p=clang Correct the function name shown in diagnostics in warn-thread-safety-analysis.c Patch by Alex Wang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199762 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Sema/warn-thread-safety-analysis.c b/test/Sema/warn-thread-safety-analysis.c index f5b2709f7f..1796f74caa 100644 --- a/test/Sema/warn-thread-safety-analysis.c +++ b/test/Sema/warn-thread-safety-analysis.c @@ -1,6 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety -Wthread-safety-beta -fcxx-exceptions %s -// FIXME: This test never worked due to a broken RUN line. -// XFAIL: * +// RUN: %clang_cc1 -fsyntax-only -verify -Wthread-safety -Wthread-safety-beta %s #define LOCKABLE __attribute__ ((lockable)) #define SCOPED_LOCKABLE __attribute__ ((scoped_lockable)) @@ -33,15 +31,10 @@ struct Foo { struct Mutex *mu_; }; -// Define mutex lock/unlock functions. -void mutex_exclusive_lock(struct Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu) { -} - -void mutex_shared_lock(struct Mutex *mu) SHARED_LOCK_FUNCTION(mu) { -} - -void mutex_unlock(struct Mutex *mu) UNLOCK_FUNCTION(mu) { -} +// Declare mutex lock/unlock functions. +void mutex_exclusive_lock(struct Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu); +void mutex_shared_lock(struct Mutex *mu) SHARED_LOCK_FUNCTION(mu); +void mutex_unlock(struct Mutex *mu) UNLOCK_FUNCTION(mu); // Define global variables. struct Mutex mu1; @@ -105,8 +98,8 @@ int main() { Foo_func3(5); - set_value(&a_, 0); // expected-warning{{calling function 'setA' requires exclusive lock on 'foo_.mu_'}} - get_value(b_); // expected-warning{{calling function 'getB' requires shared lock on 'foo_.mu_'}} + set_value(&a_, 0); // expected-warning{{calling function 'set_value' requires exclusive lock on 'foo_.mu_'}} + get_value(b_); // expected-warning{{calling function 'get_value' requires shared lock on 'foo_.mu_'}} mutex_exclusive_lock(foo_.mu_); set_value(&a_, 1); mutex_unlock(foo_.mu_);