summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/cxx-irgen.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-08-13 21:15:09 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-08-13 21:15:09 +0000
commitc9cbde7e8be50c51ce3ae4dad19aef1578a826fe (patch)
treea3cb85c348a243878df4c3cf5945b3bcffa210d3 /clang/test/Modules/cxx-irgen.cpp
parentd2228c0f728a6c107e229d6c97c926e5d5175811 (diff)
downloadbcm5719-llvm-c9cbde7e8be50c51ce3ae4dad19aef1578a826fe.tar.gz
bcm5719-llvm-c9cbde7e8be50c51ce3ae4dad19aef1578a826fe.zip
[modules] Fix a rejects-valid resulting from emitting an inline function
recursively within the emission of another inline function. This ultimately led to us emitting the same inline function definition twice, which we then rejected because we believed we had a mangled name conflict. llvm-svn: 215579
Diffstat (limited to 'clang/test/Modules/cxx-irgen.cpp')
-rw-r--r--clang/test/Modules/cxx-irgen.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/Modules/cxx-irgen.cpp b/clang/test/Modules/cxx-irgen.cpp
index 7bb12871622..4c6d81d2036 100644
--- a/clang/test/Modules/cxx-irgen.cpp
+++ b/clang/test/Modules/cxx-irgen.cpp
@@ -1,5 +1,6 @@
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -x objective-c++ -std=c++11 -fmodules-cache-path=%t -I %S/Inputs -triple %itanium_abi_triple -disable-llvm-optzns -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -fmodules -x objective-c++ -std=c++11 -fmodules-cache-path=%t -I %S/Inputs -triple %itanium_abi_triple -disable-llvm-optzns -emit-llvm -g -o - %s | FileCheck %s
// FIXME: When we have a syntax for modules in C++, use that.
@import cxx_irgen_top;
@@ -10,6 +11,22 @@ CtorInit<int> x;
@import cxx_irgen_left;
@import cxx_irgen_right;
+// Keep these two namespace definitions separate; merging them hides the bug.
+namespace EmitInlineMethods {
+ // CHECK-DAG: define linkonce_odr void @_ZN17EmitInlineMethods1C1fEPNS_1AE(
+ // CHECK-DAG: declare void @_ZN17EmitInlineMethods1A1gEv(
+ struct C {
+ __attribute__((used)) void f(A *p) { p->g(); }
+ };
+}
+namespace EmitInlineMethods {
+ // CHECK-DAG: define linkonce_odr void @_ZN17EmitInlineMethods1D1fEPNS_1BE(
+ // CHECK-DAG: define linkonce_odr void @_ZN17EmitInlineMethods1B1gEv(
+ struct D {
+ __attribute__((used)) void f(B *p) { p->g(); }
+ };
+}
+
// CHECK-DAG: define available_externally hidden {{signext i32|i32}} @_ZN1SIiE1gEv({{.*}} #[[ALWAYS_INLINE:.*]] align
int a = S<int>::g();
OpenPOWER on IntegriCloud