llvm-project/clang/test/CIR/CodeGen/deferred-defs.cpp
Andy Kaylor 90828e00a0
[CIR] Restore the underscore in dso_local (#145551)
The CIR handling of `dso_local` for globals was upstreamed without the
underscore, making it inconsistent with the incubator and LLVM IR. This
change restores the underscore.
2025-06-24 10:44:15 -07:00

23 lines
638 B
C++

// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
// RUN: FileCheck --input-file=%t.cir %s --check-prefix=CIR --implicit-check-not=unusedExternal \
// RUN: --implicit-check-not=unusedInternal
extern int usedExternal;
extern int unusedExternal;
int locallyDefined;
namespace {
int unsedInternal;
int usedInternal;
}
void use() {
usedInternal;
usedExternal;
}
// CIR: cir.global external @locallyDefined = #cir.int<0> : !s32i
// CIR: cir.global "private" internal dso_local @_ZN12_GLOBAL__N_112usedInternalE = #cir.int<0> : !s32i
// CIR: cir.global "private" external @usedExternal : !s32i