1 // RUN: %clang -fsanitize=realtime %s -o %t
2 // RUN: not %run %t 2>&1 | FileCheck %s
3 // RUN: %clang %s -o %t
4 // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NO-SANITIZE
6 # error "This test must be built in C mode"
12 // Check that we can build and run C code.
14 void nonblocking_function(void) __attribute__((nonblocking
));
16 void nonblocking_function(void) __attribute__((nonblocking
)) {
17 void *ptr
= malloc(2);
18 printf("ptr: %p\n", ptr
); // ensure we don't optimize out the malloc
22 nonblocking_function();
27 // CHECK: ==ERROR: RealtimeSanitizer
28 // CHECK-NO-SANITIZE: Done