diff options
author | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
commit | c72c57c9e9b69944e3e009cd5e209634839581d3 (patch) | |
tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /test/CodeGenCXX/extern-c.cpp | |
parent | 5b20025c30d23d521e12c1f33ec8fa6b821952cd (diff) | |
download | FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.zip FreeBSD-src-c72c57c9e9b69944e3e009cd5e209634839581d3.tar.gz |
Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
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; +} |