]> granicus.if.org Git - clang/commitdiff
Correct the function name shown in diagnostics in warn-thread-safety-analysis.c
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 21 Jan 2014 19:07:40 +0000 (19:07 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 21 Jan 2014 19:07:40 +0000 (19:07 +0000)
Patch by Alex Wang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199762 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/warn-thread-safety-analysis.c

index f5b2709f7f3ce52627f5282a97f2ccbb9e292312..1796f74caab3650a2ebfefeb437e3072782d57f8 100644 (file)
@@ -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_);