llvm-project/clang/test/CodeGenCXX/externc-used-not-replaced.cpp
Erich Keane 5c3bde9625 [CodeGen] Fix an issue when the 'extern C' replacement names broke
Originally broken by me in D122608, this is a regression where we
attempt to replace an extern-C thing with 'itself'.  The problem is that
we end up deleting it, causing the value to fail when it gets put into
llvm.used.
2022-06-07 11:30:59 -07:00

9 lines
230 B
C++

// RUN: %clang_cc1 -triple x86_64-windows -emit-llvm -o - %s | FileCheck %s
extern "C" {
const char a __attribute__((used)){};
}
// CHECK: @a = internal constant i8 0
// CHECK: @llvm.used = appending global [1 x ptr] [ptr @a]