Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenCXX / mangle-extern-local.cpp
blob111a3ec98e905a2aa319d7536c0f4c4be2849ef1
1 // RUN: %clang_cc1 %s -triple i386-unknown-unknown -emit-llvm -o - | FileCheck %s
3 // CHECK: @var1 = external global i32
4 // CHECK: @_ZN1N4var2E = external global i32
5 // CHECK: @var5 = external global i32
6 // CHECK: @_ZN1N4var3E = external global i32
7 // CHECK: @_ZN1N4var4E = external global i32
9 // CHECK: declare noundef i32 @_Z5func1v()
10 // CHECK: declare noundef i32 @_ZN1N5func2Ev()
11 // CHECK: declare i32 @func4()
12 // CHECK: declare noundef i32 @_ZN1N5func3Ev()
14 int f1() {
15 extern int var1, func1();
16 return var1 + func1();
19 namespace N {
21 int f2() {
22 extern int var2, func2();
23 return var2 + func2();
26 struct S {
27 static int f3() {
28 extern int var3, func3();
29 struct LC { int localfunc() { extern int var4; return var4; } };
30 LC localobj;
31 return var3 + func3() + localobj.localfunc();
35 int anchorf3() { return S::f3(); }
37 extern "C" {
38 int f4() {
39 extern int var5, func4();
40 return var5 + func4();