// ============================================================================ // // Test Name: MFLK0401.CPP // // Suite: IBM VisualAge C++ Member Function Linkage Keyword Bucket // // Product: IBM VisualAge C++ Version 3.0 // // Author: P. Ng // // ---------------------------------------------------------------------------- // // Tested Op/Func: // // - Linkage consistency test // - Member function declaration and definition contain the same // linkage keyword // // ---------------------------------------------------------------------------- // // Required Compile/Link Options: // // none // // ---------------------------------------------------------------------------- // // Execution // instructions : Standard compile and execute. // // Expected // results : Standard "Testcase Successful" message. // // ---------------------------------------------------------------------------- // // Modification History: // // Date Init Ver Ref # Description // --------- ---- ---- -------- -------------------------------------- // 21.Aug.95 PNG 1.00 43277 Initial creation // // ============================================================================ int global_rc = 0; #include "mflkutil.h" #include "mflk0401.h" // member function declarations // member function definition with no keyword float LK_none::mf MF_ARGS() { if ARG_VALUES_CHANGED() { printf( "Error %d: (%s:%d) LK_none - argument values not passed properly.\n", ++global_rc, __FILE__, __LINE__ ); print_diff ARG_BEING_COMPARED(); } return f1; } // member function definition with _Optlink keyword float _Optlink LK_opt::mf MF_ARGS() { if ARG_VALUES_CHANGED() { printf( "Error %d: (%s:%d) LK_opt - argument values not passed properly.\n", ++global_rc, __FILE__, __LINE__ ); print_diff ARG_BEING_COMPARED(); } return f1; } // member function definition with _System keyword float _System LK_sys::mf MF_ARGS() { if ARG_VALUES_CHANGED() { printf( "Error %d: (%s:%d) LK_sys - argument values not passed properly.\n", ++global_rc, __FILE__, __LINE__ ); print_diff ARG_BEING_COMPARED(); } return f1; } // member function definition with __stdcall keyword float __stdcall LK_stdcall::mf MF_ARGS() { if ARG_VALUES_CHANGED() { printf( "Error %d: (%s:%d) LK_stdcall - argument values not passed properly.\n", ++global_rc, __FILE__, __LINE__ ); print_diff ARG_BEING_COMPARED(); } return f1; } // member function definition with __cdecl keyword float __cdecl LK_cdecl::mf MF_ARGS() { if ARG_VALUES_CHANGED() { printf( "Error %d: (%s:%d) LK_cdecl - argument values not passed properly.\n", ++global_rc, __FILE__, __LINE__ ); print_diff ARG_BEING_COMPARED(); } return f1; } // member function definition with _Pascal keyword float _Pascal LK_pas::mf MF_ARGS() { if ARG_VALUES_CHANGED() { printf( "Error %d: (%s:%d) LK_pas - argument values not passed properly.\n", ++global_rc, __FILE__, __LINE__ ); print_diff ARG_BEING_COMPARED(); } return f1; } int main (void) { LK_none obj_none; LK_opt obj_opt; LK_sys obj_sys; LK_stdcall obj_stdcall; LK_cdecl obj_cdecl; LK_pas obj_pas; obj_none.mf CALLER_ARGS(); obj_opt.mf CALLER_ARGS(); obj_sys.mf CALLER_ARGS(); obj_stdcall.mf CALLER_ARGS(); obj_cdecl.mf CALLER_ARGS(); obj_pas.mf CALLER_ARGS(); return global_rc; }