diff options
Diffstat (limited to 'test/CodeGenCXX/extern-c.cpp')
-rw-r--r-- | test/CodeGenCXX/extern-c.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/test/CodeGenCXX/extern-c.cpp b/test/CodeGenCXX/extern-c.cpp index ca5cd73..a8c4f0c 100644 --- a/test/CodeGenCXX/extern-c.cpp +++ b/test/CodeGenCXX/extern-c.cpp @@ -1,16 +1,38 @@ -// RUN: %clang_cc1 -emit-llvm %s -o %t +// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s namespace foo { -// RUN: not grep "@a = global i32" %t +// CHECK-NOT: @a = global i32 extern "C" int a; -// RUN: not grep "@_ZN3foo1bE = global i32" %t +// CHECK-NOT: @_ZN3foo1bE = global i32 extern int b; -// RUN: grep "@_ZN3foo1cE = global i32" %t | count 1 +// CHECK: @_ZN3foo1cE = global i32 int c = 5; -// RUN: not grep "@_ZN3foo1dE" %t +// CHECK-NOT: @_ZN3foo1dE extern "C" struct d; } + +namespace test1 { + namespace { + struct X {}; + } + extern "C" { + // CHECK: @test1_b = global + X test1_b = X(); + } + void *use = &test1_b; + // CHECK: @_ZN5test13useE = global +} + +namespace test2 { + namespace { + struct X {}; + } + + // CHECK: @test2_b = global + extern "C" X test2_b; + X test2_b; +} |