aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/anonymous-namespaces.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-10-01 00:25:31 +0000
committerJohn McCall <rjmccall@apple.com>2009-10-01 00:25:31 +0000
commit4fa53427585ceea6e5e947bc19e7cfbce17bb4fa (patch)
tree0bad8cf4cb2935a36ae940f4db40ae6e0ceab28c /clang/test/CodeGenCXX/anonymous-namespaces.cpp
parente0709cfc9247239ea4e083c2b8f0a6e570bd3666 (diff)
downloadllvm-4fa53427585ceea6e5e947bc19e7cfbce17bb4fa.zip
llvm-4fa53427585ceea6e5e947bc19e7cfbce17bb4fa.tar.gz
llvm-4fa53427585ceea6e5e947bc19e7cfbce17bb4fa.tar.bz2
Anonymous namespaces, sema + codegen. A lot of semantics are still broken,
apparently because using directives aren't quite working correctly. llvm-svn: 83184
Diffstat (limited to 'clang/test/CodeGenCXX/anonymous-namespaces.cpp')
-rw-r--r--clang/test/CodeGenCXX/anonymous-namespaces.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/anonymous-namespaces.cpp b/clang/test/CodeGenCXX/anonymous-namespaces.cpp
new file mode 100644
index 0000000..dcfd518
--- /dev/null
+++ b/clang/test/CodeGenCXX/anonymous-namespaces.cpp
@@ -0,0 +1,22 @@
+// RUN: clang-cc -emit-llvm %s -o - | FileCheck %s
+
+namespace {
+ // CHECK: @_ZN12_GLOBAL__N_11aE = internal global i32 0
+ int a = 0;
+
+ // CHECK: define internal i32 @_ZN12_GLOBAL__N_13fooEv()
+ int foo() {
+ return 32;
+ }
+
+ // CHECK: define internal i32 @_ZN12_GLOBAL__N_11A3fooEv()
+ namespace A {
+ int foo() {
+ return 45;
+ }
+ }
+}
+
+int concrete() {
+ return a + foo() + A::foo();
+}