diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2016-11-10 08:49:37 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2016-11-10 08:49:37 +0000 |
commit | 8323711b075b24d12b58fce2d033129bd0bb2549 (patch) | |
tree | 5d08ae8a69d74be6fe1daad3de4aaefeb802421c /test/OpenMP/target_data_use_device_ptr_ast_print.cpp | |
parent | 3b61b92e0fdf5093a247270ef1265c85697de3f9 (diff) |
Make output of -ast-print a valid C++ code.
Output generated by option -ast-print looks like C/C++ code, and it
really is for plain C. For C++ the produced output was not valid C++
code, but the differences were small. With this change the output
is fixed and can be compiled. Tests are changed so that output produced
by -ast-print is compiled again with the same flags and both outputs are
compared.
Option -ast-print is extensively used in clang tests but it itself
was tested poorly, existing tests only checked that compiler did not
crash. There are unit tests in file DeclPrinterTest.cpp, but they test
only terse output mode.
Differential Revision: https://reviews.llvm.org/D26452
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286439 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/target_data_use_device_ptr_ast_print.cpp')
-rw-r--r-- | test/OpenMP/target_data_use_device_ptr_ast_print.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/OpenMP/target_data_use_device_ptr_ast_print.cpp b/test/OpenMP/target_data_use_device_ptr_ast_print.cpp index 4e3253b279..ce1ec1d279 100644 --- a/test/OpenMP/target_data_use_device_ptr_ast_print.cpp +++ b/test/OpenMP/target_data_use_device_ptr_ast_print.cpp @@ -110,7 +110,7 @@ T tmain(T argc) { return 0; } -// CHECK: template <typename T = int> int tmain(int argc) { +// CHECK: template<> int tmain<int>(int argc) { // CHECK-NEXT: int i; // CHECK-NEXT: int &j = i; // CHECK-NEXT: int *k = &j; @@ -120,7 +120,7 @@ T tmain(T argc) { // CHECK-NEXT: } // CHECK-NEXT: #pragma omp target data map(tofrom: i) use_device_ptr(z) -// CHECK: template <typename T = int *> int *tmain(int *argc) { +// CHECK: template<> int *tmain<int *>(int *argc) { // CHECK-NEXT: int *i; // CHECK-NEXT: int *&j = i; // CHECK-NEXT: int **k = &j; |