source: rtems/testsuites/libtests/dl04/dl-load.c @ 381c42b

5
Last change on this file since 381c42b was 381c42b, checked in by Chris Johns <chrisj@…>, on 08/12/16 at 09:18:38

testsuite: Add libdl/dl04 cache test.

  • Property mode set to 100644
File size: 749 bytes
Line 
1/*
2 * Copyright (c) 2016 Chris Johns <chrisj@rtems.org>.  All rights reserved.
3 *
4 * The license and distribution terms for this file may be
5 * found in the file LICENSE in this distribution or at
6 * http://www.rtems.org/license/LICENSE.
7 */
8
9#ifdef HAVE_CONFIG_H
10  #include "config.h"
11#endif
12
13#include "tmacros.h"
14
15#include <stdio.h>
16
17#include <dlfcn.h>
18
19#include <rtems/rtl/rtl-trace.h>
20
21#include "dl-load.h"
22
23int dl_load_test(void)
24{
25  void*       handle;
26  const char* err;
27
28  rtems_rtl_trace_set_mask(RTEMS_RTL_TRACE_ALL);
29  handle = dlopen("/dl-o4.o", RTLD_GLOBAL | RTLD_NOW);
30  err = dlerror();
31  if (err != NULL)
32    printf("dlopen: %s\n", err);
33  rtems_test_assert(handle != NULL);
34  rtems_test_assert(dlclose(handle) == 0);
35
36  return 0;
37}
Note: See TracBrowser for help on using the repository browser.