diff options
| author | Hans Wennborg <hans@hanshq.net> | 2014-01-13 19:48:13 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2014-01-13 19:48:13 +0000 |
| commit | 9125b08b523524581280896d66a010517b2d1d28 (patch) | |
| tree | 9c783a66e328c8a38eed6c94adf721cdffe57fea /clang/test/SemaCXX/warn-reinterpret-base-class.cpp | |
| parent | 4f017ceedae8245e11ad803f5698ec8afeb8f446 (diff) | |
| download | bcm5719-llvm-9125b08b523524581280896d66a010517b2d1d28.tar.gz bcm5719-llvm-9125b08b523524581280896d66a010517b2d1d28.zip | |
Update tests in preparation for using the MS ABI for Win32 targets
In preparation for making the Win32 triple imply MS ABI mode,
make all tests pass in this mode, or make them use the Itanium
mode explicitly.
Differential Revision: http://llvm-reviews.chandlerc.com/D2401
llvm-svn: 199130
Diffstat (limited to 'clang/test/SemaCXX/warn-reinterpret-base-class.cpp')
| -rw-r--r-- | clang/test/SemaCXX/warn-reinterpret-base-class.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/warn-reinterpret-base-class.cpp b/clang/test/SemaCXX/warn-reinterpret-base-class.cpp index 36b8fda5530..f7d5bc551fa 100644 --- a/clang/test/SemaCXX/warn-reinterpret-base-class.cpp +++ b/clang/test/SemaCXX/warn-reinterpret-base-class.cpp @@ -1,5 +1,8 @@ -// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s -// RUN: not %clang_cc1 -std=c++11 -fsyntax-only -fdiagnostics-parseable-fixits -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -cxx-abi itanium -verify -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -cxx-abi microsoft -DMSABI -verify -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s + +// RUN: not %clang_cc1 -std=c++11 -fsyntax-only -cxx-abi itanium -fdiagnostics-parseable-fixits -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s 2>&1 | FileCheck %s +// RUN: not %clang_cc1 -std=c++11 -fsyntax-only -cxx-abi microsoft -fdiagnostics-parseable-fixits -Wreinterpret-base-class -Wno-unused-volatile-lvalue %s 2>&1 | FileCheck %s // PR 13824 class A { @@ -288,6 +291,11 @@ void different_subobject_downcast(E *e, F *f, A *a) { (void)reinterpret_cast<I *>(f); // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:25}:"static_cast" +#ifdef MSABI + // In MS ABI mode, A is at non-zero offset in H. + // expected-warning@+3 {{'reinterpret_cast' to class 'H *' from its base at non-zero offset 'A *' behaves differently from 'static_cast'}} + // expected-note@+2 {{use 'static_cast'}} +#endif (void)reinterpret_cast<H *>(a); // expected-warning@+2 {{'reinterpret_cast' to class 'L' (aka 'const F *volatile') from its base at non-zero offset 'E *' behaves differently from 'static_cast'}} @@ -309,6 +317,12 @@ void different_subobject_upcast(F *f, G *g, H *h, I *i) { // CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:9-[[@LINE-1]]:25}:"static_cast" (void)reinterpret_cast<E *>(h); + +#ifdef MSABI + // In MS ABI mode, A is at non-zero offset in H. + // expected-warning@+3 {{'reinterpret_cast' from class 'H *' to its base at non-zero offset 'A *' behaves differently from 'static_cast'}} + // expected-note@+2 {{use 'static_cast'}} +#endif (void)reinterpret_cast<A *>(h); // expected-warning@+2 {{'reinterpret_cast' from class 'I *' to its virtual base 'F *' behaves differently from 'static_cast'}} |

