1 // RUN: %clang_cc1 -std=c++11 -fms-extensions -fms-compatibility -fsyntax-only -triple=i386-pc-win32 -verify %s 2 3 struct A { int a; }; 4 5 #pragma vtordisp(pop) // expected-warning {{#pragma vtordisp(pop, ...) failed: stack empty}} 6 #pragma vtordisp(push, 0) 7 #pragma vtordisp(push, 1) 8 #pragma vtordisp(push, 2) 9 struct B : virtual A { int b; }; 10 #pragma vtordisp(pop) 11 #pragma vtordisp(pop) 12 #pragma vtordisp(pop) 13 #pragma vtordisp(pop) // expected-warning {{#pragma vtordisp(pop, ...) failed: stack empty}} 14 15 #pragma vtordisp(push, 3) // expected-warning {{expected integer between 0 and 2 inclusive in '#pragma vtordisp' - ignored}} 16 #pragma vtordisp() 17 18 #define ONE 1 19 #pragma vtordisp(push, ONE) 20 #define TWO 1 21 #pragma vtordisp(push, TWO) 22 23 // Test a reset. 24 #pragma vtordisp() 25 #pragma vtordisp(pop) // expected-warning {{#pragma vtordisp(pop, ...) failed: stack empty}} 26 27 #pragma vtordisp( // expected-warning {{unknown action for '#pragma vtordisp' - ignored}} 28 #pragma vtordisp(asdf) // expected-warning {{unknown action for '#pragma vtordisp' - ignored}} 29 #pragma vtordisp(,) // expected-warning {{unknown action for '#pragma vtordisp' - ignored}} 30 #pragma vtordisp // expected-warning {{missing '(' after '#pragma vtordisp' - ignoring}} 31 #pragma vtordisp(3) // expected-warning {{expected integer between 0 and 2 inclusive in '#pragma vtordisp' - ignored}} 32 #pragma vtordisp(), stuff // expected-warning {{extra tokens}} 33 34 struct C { 35 // FIXME: Our implementation based on token insertion makes it impossible for 36 // the pragma to appear everywhere we should support it. 37 //#pragma vtordisp() 38 struct D : virtual A { 39 }; 40 }; 41