summaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp')
-rw-r--r--test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp b/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp
index 193ee5f80406..b90620ab600f 100644
--- a/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp
+++ b/test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp
@@ -225,3 +225,19 @@ namespace Test9 {
return -static_cast<RA&>(*x);
}
}
+
+namespace Test10 {
+ struct A {
+ virtual int f();
+ };
+
+ struct B : A {
+ int f() final;
+ };
+
+ // CHECK-LABEL: define i32 @_ZN6Test101fEPNS_1BE
+ int f(B *b) {
+ // CHECK: call i32 @_ZN6Test101B1fEv
+ return static_cast<A *>(b)->f();
+ }
+}