summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/thunks.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-02-19 02:53:41 +0000
committerJohn McCall <rjmccall@apple.com>2011-02-19 02:53:41 +0000
commit837796754391377198973bac26fb2f229a4665f6 (patch)
treed247c984367931e2828fd281cfefc385da24029d /clang/test/CodeGenCXX/thunks.cpp
parent85e8b8149243052c721c97ad97ebda82867071a4 (diff)
downloadbcm5719-llvm-837796754391377198973bac26fb2f229a4665f6.tar.gz
bcm5719-llvm-837796754391377198973bac26fb2f229a4665f6.zip
Warn about code that uses variables and functions with internal linkage
without defining them. This should be an error, but I'm paranoid about "uses" that end up not actually requiring a definition. I'll revisit later. Also, teach IR generation to not set internal linkage on variable declarations, just for safety's sake. Doing so produces an invalid module if the variable is not ultimately defined. Also, fix several places in the test suite where we were using internal functions without definitions. llvm-svn: 126016
Diffstat (limited to 'clang/test/CodeGenCXX/thunks.cpp')
-rw-r--r--clang/test/CodeGenCXX/thunks.cpp44
1 files changed, 21 insertions, 23 deletions
diff --git a/clang/test/CodeGenCXX/thunks.cpp b/clang/test/CodeGenCXX/thunks.cpp
index 238032cc6de..a74cc053dbe 100644
--- a/clang/test/CodeGenCXX/thunks.cpp
+++ b/clang/test/CodeGenCXX/thunks.cpp
@@ -88,31 +88,29 @@ void C::f() { }
}
// Check that the thunk gets internal linkage.
-namespace {
-
-struct A {
- virtual void f();
-};
-
-struct B {
- virtual void f();
-};
-
-struct C : A, B {
- virtual void c();
-
- virtual void f();
-};
+namespace Test4B {
+ struct A {
+ virtual void f();
+ };
-void C::f() { }
+ struct B {
+ virtual void f();
+ };
-}
+ namespace {
+ struct C : A, B {
+ virtual void c();
+ virtual void f();
+ };
+ }
+ void C::c() {}
+ void C::f() {}
-// Force C::f to be used.
-void f() {
- C c;
-
- c.f();
+ // Force C::f to be used.
+ void f() {
+ C c;
+ c.f();
+ }
}
namespace Test5 {
@@ -283,4 +281,4 @@ namespace Test11 {
// This is from Test5:
// CHECK: define linkonce_odr void @_ZTv0_n24_N5Test51B1fEv
-// CHECK: define internal void @_ZThn8_N12_GLOBAL__N_11C1fEv(
+// CHECK: define internal void @_ZThn8_N6Test4B12_GLOBAL__N_11C1fEv(
OpenPOWER on IntegriCloud