Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1437)

Unified Diff: tests/toolchain/dwarf_method_ptr.cc

Issue 1021303003: Enable using the toolchain (llvm) provided FileCheck. (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: nacl_clang Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « site_scons/site_tools/naclsdk.py ('k') | tests/toolchain/nacl.scons » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/toolchain/dwarf_method_ptr.cc
diff --git a/tests/toolchain/dwarf_method_ptr.cc b/tests/toolchain/dwarf_method_ptr.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f3d475760404a88a24899332b5ab7e63dd47c8be
--- /dev/null
+++ b/tests/toolchain/dwarf_method_ptr.cc
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2012 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* Test that dwarf info for method pointers is preserved after linking.
+ *
+ */
+
+class TestClass {
+ public:
+ int foo() { return 42; }
+};
+
+typedef int (TestClass::*method_ptr)();
+
+__attribute__((noinline)) static int foo(TestClass *dwarf_test_method_ptr_param,
+ method_ptr *mp) {
+ // CHECK-DAG: (DW_TAG_formal_parameter)
+ // CHECK-DAG: DW_AT_location
+ // CHECK: DW_AT_name{{.*}} dwarf_test_method_ptr_param
+ // CHECK-NEXT: {{.*}}DW_AT_decl_file{{.*}} : 1
+ // CHECK-NEXT: {{.*}}DW_AT_decl_line{{.*}} : 18
+ return (dwarf_test_method_ptr_param->**mp)();
+}
+
+int caller(TestClass *my_test_param) {
+ method_ptr mp = &TestClass::foo;
+ return foo(my_test_param, &mp);
+}
+
+int main() {
+ TestClass TC;
+ int ret = caller(&TC);
+ return ret;
+}
« no previous file with comments | « site_scons/site_tools/naclsdk.py ('k') | tests/toolchain/nacl.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698