mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 13:46:07 +00:00

In incremental compilation clang works with multiple `llvm::Module`s. Our current approach is to create a CodeGenModule entity for every new module request (via StartModule). However, some of the state such as the mangle context needs to be preserved to keep the original semantics in the ever-growing TU. Fixes: llvm/llvm-project#95581. cc: @jeaye
14 lines
367 B
C++
14 lines
367 B
C++
// REQUIRES: host-supports-jit
|
|
// UNSUPPORTED: system-aix
|
|
//
|
|
// RUN: cat %s | clang-repl | FileCheck %s
|
|
// RUN: cat %s | clang-repl -Xcc -O2 | FileCheck %s
|
|
|
|
struct box { box() = default; box(int *const data) : data{data} {} int *data{}; };
|
|
|
|
box foo() { box ret; ret = new int{}; return ret; }
|
|
|
|
extern "C" int printf(const char *, ...);
|
|
printf("good");
|
|
// CHECK: good
|