diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
| commit | 809500fc2c13c8173a16b052304d983864e4a1e1 (patch) | |
| tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /test/CodeGenCXX/extern-c.cpp | |
| parent | be7c9ec198dcdb5bf73a35bfbb00b3333cb87909 (diff) | |
Notes
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 ca5cd7372cad..a8c4f0cdbd30 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; +} |
