mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 08:26:06 +00:00

EmitTargetMetadata passed to emitTargetMD a null pointer as returned from GetGlobalValue, for an unused inline function which has been removed from the module at that point. A FIXME in CodeGenModule.cpp commented that the calling code in EmitTargetMetadata should be moved into the one target that needs it (XCore). A review comment agreed. So the calling loop has been moved into the XCore subclass. The check for null is done in that loop. Differential Revision: https://reviews.llvm.org/D77068
10 lines
390 B
C
10 lines
390 B
C
// REQUIRES: xcore-registered-target
|
|
// RUN: %clang_cc1 -triple xcore-unknown-unknown -emit-llvm -o - %s
|
|
|
|
// D77068 fixes a segmentation fault and assertion failure "Unexpected null
|
|
// Value" in the case of an unused inline function, when targeting xcore. This
|
|
// test verifies that clang does not crash and does not produce code for such a
|
|
// function.
|
|
|
|
inline void dead_function(void) {}
|