]> granicus.if.org Git - clang/commitdiff
Remove assert header dependency in test
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 29 Jul 2013 22:37:42 +0000 (22:37 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 29 Jul 2013 22:37:42 +0000 (22:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187387 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 404374739b969d02299c23cc7afb208580d9ea3c..1918aceee6dac9e4c905c4bdaa08fd94304cbff7 100644 (file)
@@ -1,7 +1,5 @@
 // RUN: %clang -fsyntax-only -verify -Wthread-safety -Wthread-safety-beta -fcxx-exceptions %s
 
-#include <assert.h>
-
 #define LOCKABLE            __attribute__ ((lockable))
 #define SCOPED_LOCKABLE     __attribute__ ((scoped_lockable))
 #define GUARDED_BY(x)       __attribute__ ((guarded_by(x)))
@@ -111,14 +109,14 @@ int main() {
   set_value(&a_, 1);
   mutex_unlock(foo_.mu_);
   mutex_shared_lock(foo_.mu_);
-  assert(get_value(b_) == 1);
+  (void)(get_value(b_) == 1);
   mutex_unlock(foo_.mu_);
 
   c_ = 0; // expected-warning{{writing variable 'c_' requires locking any mutex exclusively}}
-  assert(*d_ == 0); // expected-warning{{reading the value pointed to by 'd_' requires locking any mutex}}
+  (void)(*d_ == 0); // expected-warning{{reading the value pointed to by 'd_' requires locking any mutex}}
   mutex_exclusive_lock(foo_.mu_);
   c_ = 1;
-  assert(*d_ == 1);
+  (void)(*d_ == 1);
   mutex_unlock(foo_.mu_);
 
   return 0;