}
int main() {
- NSLog(@"Hello world");
+ fprintf(stderr,"Hello world");
}
// CHECK-NOT: AddressSanitizer: odr-violation
// Check that suppressing the interceptor by name works.
// RUN: echo "interceptor_name:memmove" > %t.supp
+// RUN: echo "interceptor_name:memcpy" >> %t.supp
// RUN: %env_asan_opts=suppressions='"%t.supp"' %run %t 2>&1 | FileCheck --check-prefix=CHECK-IGNORE %s
// Check that suppressing by interceptor name works even without the symbolizer
#import <Foundation/Foundation.h>
int main() {
- NSLog(@"Hello world");
+ fprintf(stderr,"Hello world");
dispatch_queue_t q = dispatch_queue_create("my.queue", DISPATCH_QUEUE_SERIAL);
dispatch_async(q, ^{
- NSLog(@"1");
+ fprintf(stderr,"1");
});
dispatch_async(q, ^{
- NSLog(@"2");
+ fprintf(stderr,"2");
});
dispatch_async(q, ^{
- NSLog(@"3");
+ fprintf(stderr,"3");
dispatch_async(dispatch_get_main_queue(), ^{
- NSLog(@"Done.");
+ fprintf(stderr,"Done.");
sleep(1);
exit(0);
});
// RUN: %clang_tsan %s -o %t -framework Foundation
-// RUN: %run %t 2>&1
+// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1
#import <Foundation/Foundation.h>
// RUN: %clang_tsan %s -o %t -framework Foundation
-// RUN: %deflake %run %t 2>&1
+// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1
#import <Foundation/Foundation.h>
// RUN: %clang_tsan %s -o %t -framework Foundation
-// RUN: %run %t 2>&1
+// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1
#import <Foundation/Foundation.h>
// RUN: %clang_tsan %s -o %t -framework Foundation
-// RUN: %run %t 2>&1
+// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1
#import <Foundation/Foundation.h>
// RUN: %clang_tsan %s -o %t -framework Foundation
-// RUN: %run %t 2>&1
+// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1
#import <Foundation/Foundation.h>
// RUN: %clang_tsan %s -o %t -framework Foundation
-// RUN: %run %t 2>&1
+// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1
#import <Foundation/Foundation.h>
// RUN: %clang_tsan %s -o %t -framework Foundation
-// RUN: %run %t 2>&1
+// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1
#import <Foundation/Foundation.h>
// RUN: %clang_tsan %s -o %t -framework Foundation
-// RUN: %run %t 2>&1
+// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1
#import <Foundation/Foundation.h>
// RUN: %clang_tsan %s -o %t -framework Foundation
-// RUN: %deflake %run %t 2>&1
+// RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %deflake %run %t 2>&1
#import <Foundation/Foundation.h>
}
int main(int argc, char *argv[]) {
- NSLog(@"Hello world.");
+ fprintf(stderr, "Hello world.\n");
// NSUserDefaults uses XPC which triggers the false positive.
NSDictionary *d = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
- NSLog(@"d = %@", d);
if (argc > 1 && strcmp(argv[1], "race") == 0) {
barrier_init(&barrier, 2);
pthread_join(t[1], NULL);
}
- NSLog(@"Done.");
+ fprintf(stderr, "Done.\n");
}
// CHECK: Hello world.