[PATCH] D11315: Regression test for simple devirtualization (microsoft abi)
Andrew Zhogin
andrew.zhogin at gmail.com
Fri Jul 17 16:14:59 PDT 2015
andrew.zhogin updated this revision to Diff 30049.
andrew.zhogin added a comment.
Added "// REQUIRES: x86-registered-target"
http://reviews.llvm.org/D11315
Files:
test/Analysis/devirtualize-virtual-function-calls-constprop.cpp
Index: test/Analysis/devirtualize-virtual-function-calls-constprop.cpp
===================================================================
--- test/Analysis/devirtualize-virtual-function-calls-constprop.cpp
+++ test/Analysis/devirtualize-virtual-function-calls-constprop.cpp
@@ -0,0 +1,17 @@
+// REQUIRES: x86-registered-target
+// RUN: %clang_cc1 -O3 %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -O3 %s -triple x86_64-win32 -emit-llvm -o - | FileCheck %s
+
+struct A {
+ virtual int f() { return 7; }
+ virtual int f_const() const { return 3; }
+};
+
+// CHECK: ret i32 10
+int f() {
+ A *ptr = new A();
+
+ int rv = ptr->f() + ptr->f_const();
+ delete ptr;
+ return rv;
+}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11315.30049.patch
Type: text/x-patch
Size: 711 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150717/ac8348c2/attachment.bin>
More information about the cfe-commits
mailing list