<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - KaleidoscopeJIT crash on initialization"
   href="https://bugs.llvm.org/show_bug.cgi?id=50915">50915</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>KaleidoscopeJIT crash on initialization
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows XP
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>OrcJIT
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>kacpero376@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>1101.debian@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>What steps will reproduce the problem?
1. create a basic CMake project and include all the necessary llvm components
2. include KaleidoscopeJIT.h from
examples/Kaleidoscope/include/KaleidoscopeJIT.h in main file
3. initialise the llvm::orc::KaleidoscopeJIT class
4. print a message before the initialisation and after initialisation  

What is the expected output?
============================

No crash is expected, the message before and after should be printed.

Output:
hello there 1
hello there 2


What do you see instead?
========================

Message before the initialisation appears in console however the message after
is not present and the program stops. 

Output:
hello there 1


What version of the product are you using? On what operating system?
====================================================================

LLVM 10.0.1 on Windows 10 (latest update)


Please provide any additional information below.
================================================

example program for bug reproduction:
test.cxx

#include "path_to_examples/KaleidoscopeJIT.h"
#include <memory>
#include <iostream>

int main(){

    std::cout << "hello there 1" << std::endl;

    // both the version with unique_ptr and without cause the crash...
    std::unique_ptr<llvm::orc::KaleidoscopeJIT> JIT =
std::make_unique<llvm::orc::KaleidoscopeJIT>();
    // llvm::orc::KaleidoscopeJIT JIT = llvm::orc::KaleidoscopeJIT();

    std::cout << "hello there 2" << std::endl;

    return 0;
}

basic CMake configuration:

cmake_minimum_required(VERSION 3.10)

# set the project name
project(testproject VERSION 1.0)

# specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# LLVM
find_package(LLVM REQUIRED CONFIG)

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")

add_definitions(${LLVM_DEFINITIONS})

add_executable(test1 test.cxx)

llvm_map_components_to_libnames(llvm_libs 
    core executionengine target orcjit support irreader 
        )
target_link_libraries(test1 PUBLIC "${llvm_libs}")

target_include_directories(test1 PUBLIC "${LLVM_INCLUDE_DIRS}")</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>