2013-03-12 23:06:22 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
|
2009-05-17 05:02:39 +08:00
|
|
|
namespace foo {
|
|
|
|
|
2013-03-12 23:06:22 +08:00
|
|
|
// CHECK-NOT: @a = global i32
|
2009-05-17 05:02:39 +08:00
|
|
|
extern "C" int a;
|
|
|
|
|
2013-03-12 23:06:22 +08:00
|
|
|
// CHECK-NOT: @_ZN3foo1bE = global i32
|
2009-05-17 05:02:39 +08:00
|
|
|
extern int b;
|
|
|
|
|
2013-03-12 23:06:22 +08:00
|
|
|
// CHECK: @_ZN3foo1cE = global i32
|
2009-05-17 05:02:39 +08:00
|
|
|
int c = 5;
|
|
|
|
|
2013-03-12 23:06:22 +08:00
|
|
|
// CHECK-NOT: @_ZN3foo1dE
|
2010-02-07 16:38:28 +08:00
|
|
|
extern "C" struct d;
|
|
|
|
|
2009-05-17 05:02:39 +08:00
|
|
|
}
|
2013-03-12 23:06:22 +08:00
|
|
|
|
|
|
|
namespace test1 {
|
|
|
|
namespace {
|
|
|
|
struct X {};
|
|
|
|
}
|
|
|
|
extern "C" {
|
2013-03-12 23:22:39 +08:00
|
|
|
// CHECK: @test1_b = global
|
|
|
|
X test1_b = X();
|
2013-03-12 23:06:22 +08:00
|
|
|
}
|
2013-03-12 23:22:39 +08:00
|
|
|
void *use = &test1_b;
|
2013-03-12 23:06:22 +08:00
|
|
|
// CHECK: @_ZN5test13useE = global
|
|
|
|
}
|
2013-03-12 23:22:39 +08:00
|
|
|
|
|
|
|
namespace test2 {
|
|
|
|
namespace {
|
|
|
|
struct X {};
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK: @test2_b = global
|
|
|
|
extern "C" X test2_b;
|
|
|
|
X test2_b;
|
|
|
|
}
|