Blame tests/system-elf-libelf-test.c

Packit Service 97d2fb
/* Explicit test compiling with system elf.h header plus libelf header.
Packit Service 97d2fb
Packit Service 97d2fb
   Copyright (C) 2016 Red Hat, Inc.
Packit Service 97d2fb
   This file is part of elfutils.
Packit Service 97d2fb
Packit Service 97d2fb
   This file is free software; you can redistribute it and/or modify
Packit Service 97d2fb
   it under the terms of the GNU General Public License as published by
Packit Service 97d2fb
   the Free Software Foundation; either version 3 of the License, or
Packit Service 97d2fb
   (at your option) any later version.
Packit Service 97d2fb
Packit Service 97d2fb
   elfutils is distributed in the hope that it will be useful, but
Packit Service 97d2fb
   WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 97d2fb
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 97d2fb
   GNU General Public License for more details.
Packit Service 97d2fb
Packit Service 97d2fb
   You should have received a copy of the GNU General Public License
Packit Service 97d2fb
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit Service 97d2fb
Packit Service 97d2fb
#include <elf.h>
Packit Service 97d2fb
#include <stddef.h>
Packit Service 97d2fb
#include "../libelf/libelf.h"
Packit Service 97d2fb
Packit Service 97d2fb
int
Packit Service 97d2fb
main (void)
Packit Service 97d2fb
{
Packit Service 97d2fb
  /* Trivial test, this is really a compile test anyway.  */
Packit Service 97d2fb
  if (elf_version (EV_CURRENT) == EV_NONE)
Packit Service 97d2fb
    return -1;
Packit Service 97d2fb
Packit Service 97d2fb
  /* This will obviously fail. It is just to check that Elf32_Chdr and
Packit Service 97d2fb
     elf32_getchdr are available (both at compile time and runtime).  */
Packit Service 97d2fb
  Elf32_Chdr *chdr = elf32_getchdr (NULL);
Packit Service 97d2fb
Packit Service 97d2fb
  return chdr == NULL ? 0 : -1;
Packit Service 97d2fb
}