brintos

brintos / llvm-project-archived public Read only

0
0
Text · 559 B · c4c240e Raw
24 lines · plain
1// Regression test for2// https://code.google.com/p/address-sanitizer/issues/detail?id=360.3 4// RUN: %clang_asan %s -o %t -framework Foundation5// RUN: %run %t 2>&1 | FileCheck %s6 7#import <Foundation/Foundation.h>8 9void f() {10    int y = 7;11    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{12        dispatch_sync(dispatch_get_main_queue(), ^{13            printf("num = %d\n", y);14        });15    });16}17 18int main() {19  fprintf(stderr,"Hello world");20}21 22// CHECK-NOT: AddressSanitizer: odr-violation23// CHECK: Hello world24