r199762 - Correct the function name shown in diagnostics in warn-thread-safety-analysis.c
David Blaikie
dblaikie at gmail.com
Tue Jan 21 11:07:41 PST 2014
Author: dblaikie
Date: Tue Jan 21 13:07:40 2014
New Revision: 199762
URL: http://llvm.org/viewvc/llvm-project?rev=199762&view=rev
Log:
Correct the function name shown in diagnostics in warn-thread-safety-analysis.c
Patch by Alex Wang.
Modified:
cfe/trunk/test/Sema/warn-thread-safety-analysis.c
Modified: cfe/trunk/test/Sema/warn-thread-safety-analysis.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-thread-safety-analysis.c?rev=199762&r1=199761&r2=199762&view=diff
==============================================================================
--- cfe/trunk/test/Sema/warn-thread-safety-analysis.c (original)
+++ cfe/trunk/test/Sema/warn-thread-safety-analysis.c Tue Jan 21 13:07:40 2014
@@ -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_);
More information about the cfe-commits
mailing list