diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2014-04-01 21:43:23 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2014-04-01 21:43:23 +0000 |
| commit | e044904301f39b33c6f460884afd36cff495d7c2 (patch) | |
| tree | 33290cc3f6565870f87c492e56ad2266afb2aeba /clang/test/Sema/warn-thread-safety-analysis.c | |
| parent | 6b444c5c8edb6ec280cd6cdd5275ae27e31e4fc7 (diff) | |
| download | bcm5719-llvm-e044904301f39b33c6f460884afd36cff495d7c2.tar.gz bcm5719-llvm-e044904301f39b33c6f460884afd36cff495d7c2.zip | |
Updating the capability attribute diagnostics to be more capability-neutral. Instead of using terminology such as "lock", "unlock" and "locked", the new terminology is "acquire", "release" and "held". Additionally, the capability attribute's name argument is now reported as part of the diagnostic, instead of hard coding as "mutex."
llvm-svn: 205359
Diffstat (limited to 'clang/test/Sema/warn-thread-safety-analysis.c')
| -rw-r--r-- | clang/test/Sema/warn-thread-safety-analysis.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/clang/test/Sema/warn-thread-safety-analysis.c b/clang/test/Sema/warn-thread-safety-analysis.c index 62460f99fa6..6d41e40d303 100644 --- a/clang/test/Sema/warn-thread-safety-analysis.c +++ b/clang/test/Sema/warn-thread-safety-analysis.c @@ -74,14 +74,14 @@ int get_value(int *p) SHARED_LOCKS_REQUIRED(foo_.mu_){ int main() { - Foo_fun1(1); // expected-warning{{calling function 'Foo_fun1' requires shared lock on 'mu2'}} \ - expected-warning{{calling function 'Foo_fun1' requires exclusive lock on 'mu1'}} + Foo_fun1(1); // expected-warning{{calling function 'Foo_fun1' requires holding mutex 'mu2'}} \ + expected-warning{{calling function 'Foo_fun1' requires holding mutex 'mu1' exclusively}} mutex_exclusive_lock(&mu1); mutex_shared_lock(&mu2); Foo_fun1(1); - mutex_shared_lock(&mu1); // expected-warning{{locking 'mu1' that is already locked}} + mutex_shared_lock(&mu1); // expected-warning{{acquiring mutex 'mu1' that is already held}} mutex_unlock(&mu1); mutex_unlock(&mu2); mutex_shared_lock(&mu1); @@ -95,13 +95,13 @@ int main() { mutex_unlock(&mu1); mutex_exclusive_lock(&mu1); - Foo_func3(4); // expected-warning{{cannot call function 'Foo_func3' while mutex 'mu1' is locked}} + Foo_func3(4); // expected-warning{{cannot call function 'Foo_func3' while mutex 'mu1' is held}} mutex_unlock(&mu1); Foo_func3(5); - 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_'}} + set_value(&a_, 0); // expected-warning{{calling function 'set_value' requires holding mutex 'foo_.mu_' exclusively}} + get_value(b_); // expected-warning{{calling function 'get_value' requires holding mutex 'foo_.mu_'}} mutex_exclusive_lock(foo_.mu_); set_value(&a_, 1); mutex_unlock(foo_.mu_); @@ -109,19 +109,19 @@ int main() { (void)(get_value(b_) == 1); mutex_unlock(foo_.mu_); - c_ = 0; // expected-warning{{writing variable 'c_' requires locking any mutex exclusively}} - (void)(*d_ == 0); // expected-warning{{reading the value pointed to by 'd_' requires locking any mutex}} + c_ = 0; // expected-warning{{writing variable 'c_' requires holding any mutex exclusively}} + (void)(*d_ == 0); // expected-warning{{reading the value pointed to by 'd_' requires holding any mutex}} mutex_exclusive_lock(foo_.mu_); c_ = 1; (void)(*d_ == 1); mutex_unlock(foo_.mu_); mutex_exclusive_lock(&mu1); - mutex_shared_unlock(&mu1); // expected-warning {{unlocking 'mu1' using shared access, expected exclusive access}} + mutex_shared_unlock(&mu1); // expected-warning {{releasing mutex 'mu1' using shared access, expected exclusive access}} mutex_exclusive_unlock(&mu1); mutex_shared_lock(&mu1); - mutex_exclusive_unlock(&mu1); // expected-warning {{unlocking 'mu1' using exclusive access, expected shared access}} + mutex_exclusive_unlock(&mu1); // expected-warning {{releasing mutex 'mu1' using exclusive access, expected shared access}} mutex_shared_unlock(&mu1); return 0; |

