aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CIR/CodeGen/deferred-defs.cpp
blob: 0b9ff92fa2f4c4fe953ad26a988a989e2a658a7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 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