diff options
author | John McCall <rjmccall@apple.com> | 2009-10-01 00:25:31 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-10-01 00:25:31 +0000 |
commit | 9aeed32282fe8a775c24c01c923717ca86695685 (patch) | |
tree | 3cfd3627388904cf806cc552f6b3585fedbb6565 /test/CodeGenCXX/anonymous-namespaces.cpp | |
parent | 4a5c15f75f76b95e1c2ceb6fa2737dcadd5f4be1 (diff) |
Anonymous namespaces, sema + codegen. A lot of semantics are still broken,
apparently because using directives aren't quite working correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83184 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/anonymous-namespaces.cpp')
-rw-r--r-- | test/CodeGenCXX/anonymous-namespaces.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGenCXX/anonymous-namespaces.cpp b/test/CodeGenCXX/anonymous-namespaces.cpp new file mode 100644 index 0000000000..dcfd518d68 --- /dev/null +++ b/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(); +} |