brintos

brintos / llvm-project-archived public Read only

0
0
Text · 684 B · 96b1e1d Raw
28 lines · cpp
1#include "dylib.h"2#include <limits.h>3#include <stdio.h>4#include <stdlib.h>5#include <string.h>6 7int main(int argc, char const *argv[]) {8  const char *a_name = "load_a";9  void *a_dylib_handle = NULL;10 11  a_dylib_handle = dylib_open(a_name); // Set a breakpoint here.12  if (a_dylib_handle == NULL) { // Set another here - we should not hit this one13    fprintf(stderr, "%s\n", dylib_last_error());14    exit(1);15  }16 17  const char *b_name = "load_b";18  void *b_dylib_handle = NULL;19 20  b_dylib_handle = dylib_open(b_name);21  if (b_dylib_handle == NULL) { // Set a third here - we should not hit this one22    fprintf(stderr, "%s\n", dylib_last_error());23    exit(1);24  }25 26  return 0;27}28