dyld-732.8.tar.gz
[apple/dyld.git] / testing / test-cases / dtrace.dtest / main.c
1 // BUILD_ONLY: MacOSX
2
3 // if we ever re-enable this on iOS we will need to add // BOOT_ARGS: dtrace_dof_mode=1
4
5 // BUILD: /usr/sbin/dtrace -h -s main.d -o $TEMP_DIR/probes.h
6 // BUILD: $CC main.c -I$TEMP_DIR -o $BUILD_DIR/dtrace.exe
7 // BUILD: $DYLD_ENV_VARS_ENABLE $BUILD_DIR/dtrace.exe
8
9 // RUN: $SUDO dtrace -l -n 'dyld_testing*:dtrace.exe:main:callback' -c ./dtrace.exe
10
11
12
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <string.h>
16 #include <sys/sdt.h>
17
18 #include "probes.h"
19
20 int main()
21 {
22 printf("[BEGIN] dtrace\n");
23
24 DYLD_TESTING_CALLBACK();
25
26 if (!DYLD_TESTING_CALLBACK_ENABLED())
27 printf("[FAIL] dtrace: DYLD_TESTING_CALLBACK_ENABLED() returned false\n");
28 else
29 printf("[PASS] dtrace\n");
30
31 return 0;
32 }