Debian Codegraph @

clang/test/CIR/CodeGen/deferred-defs.cpp

raw
1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
2 // RUN: FileCheck --input-file=%t.cir %s --check-prefix=CIR --implicit-check-not=unusedExternal \
3 // RUN: --implicit-check-not=unusedInternal
4
5 extern int usedExternal;
6 extern int unusedExternal;
7
8 int locallyDefined;
9
10 namespace {
11 int unsedInternal;
12 int usedInternal;
13 }
14
15 void use() {
16 usedInternal;
17 usedExternal;
18 }
19
20 // CIR: cir.global external @locallyDefined = #cir.int<0> : !s32i
21 // CIR: cir.global "private" internal dso_local @_ZN12_GLOBAL__N_112usedInternalE = #cir.int<0> : !s32i
22 // CIR: cir.global "private" external @usedExternal : !s32i