You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
559 B

// Regression test for
// https://code.google.com/p/address-sanitizer/issues/detail?id=360.
// RUN: %clang_asan %s -o %t -framework Foundation
// RUN: %run %t 2>&1 | FileCheck %s
#import <Foundation/Foundation.h>
void f() {
int y = 7;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
dispatch_sync(dispatch_get_main_queue(), ^{
printf("num = %d\n", y);
});
});
}
int main() {
fprintf(stderr,"Hello world");
}
// CHECK-NOT: AddressSanitizer: odr-violation
// CHECK: Hello world