X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Futils%2Ftestapp%2Fuserspace-probe-elf-cxx-binary%2Fuserspace-probe-elf-cxx-binary.cpp;fp=tests%2Futils%2Ftestapp%2Fuserspace-probe-elf-cxx-binary%2Fuserspace-probe-elf-cxx-binary.cpp;h=c1f44ee952c43c6d77a92c915a3275180192052c;hb=a9c2df2bfce7a27b53ee5d5101f259f3e1f506b1;hp=0000000000000000000000000000000000000000;hpb=5a1c0a75771c4b95f9518be0e1960a25bb691caf;p=lttng-tools.git diff --git a/tests/utils/testapp/userspace-probe-elf-cxx-binary/userspace-probe-elf-cxx-binary.cpp b/tests/utils/testapp/userspace-probe-elf-cxx-binary/userspace-probe-elf-cxx-binary.cpp new file mode 100644 index 000000000..c1f44ee95 --- /dev/null +++ b/tests/utils/testapp/userspace-probe-elf-cxx-binary/userspace-probe-elf-cxx-binary.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2018 Francis Deslauriers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "test_class.h" + +volatile int not_a_function = 0; +void __attribute__ ((noinline)) test_cxx_function() +{ + not_a_function += 1; +} + +int main(int argc, char *argv[]) +{ + test_class my_test_class; + /* Call test function. */ + test_cxx_function(); + + /* Call test method. */ + my_test_class.test_method(); + return 0; +}