... which IMO are: 1) files don't need a _test suffix because all files in the directory are tests ;) 2) we test the BEHAVIOR of the program, rather than its binary bit contents. Ok, but nobody said a test can't use two files ;) (where the 104+_ construct is meant to prevent the file from being picked up by the makefile as a test on its own).
		
			
				
	
	
		
			54 lines
		
	
	
	
		
			1.5 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			54 lines
		
	
	
	
		
			1.5 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
 | 
						|
#define GOT(f) \
 | 
						|
    __attribute__((weak)) void f(void); \
 | 
						|
    printf("%d %s\n", !!f, #f);
 | 
						|
 | 
						|
int printf(const char*, ...);
 | 
						|
 | 
						|
void check_exports()
 | 
						|
{
 | 
						|
    // 0
 | 
						|
    GOT(inline_inline_2decl_only)
 | 
						|
    GOT(inline_inline_undeclared)
 | 
						|
    GOT(inline_inline_predeclared)
 | 
						|
    GOT(inline_inline_postdeclared)
 | 
						|
    GOT(inline_inline_prepostdeclared)
 | 
						|
    GOT(inline_inline_undeclared2)
 | 
						|
    GOT(inline_inline_predeclared2)
 | 
						|
    GOT(inline_inline_postdeclared2)
 | 
						|
    GOT(inline_inline_prepostdeclared2)
 | 
						|
 | 
						|
    // 1
 | 
						|
    GOT(extern_extern_postdeclared)
 | 
						|
    GOT(extern_extern_postdeclared2)
 | 
						|
    GOT(extern_extern_predeclared)
 | 
						|
    GOT(extern_extern_predeclared2)
 | 
						|
    GOT(extern_extern_prepostdeclared)
 | 
						|
    GOT(extern_extern_prepostdeclared2)
 | 
						|
    GOT(extern_extern_undeclared)
 | 
						|
    GOT(extern_extern_undeclared2)
 | 
						|
    GOT(extern_postdeclared)
 | 
						|
    GOT(extern_postdeclared2)
 | 
						|
    GOT(extern_predeclared)
 | 
						|
    GOT(extern_predeclared2)
 | 
						|
    GOT(extern_prepostdeclared)
 | 
						|
    GOT(extern_undeclared)
 | 
						|
    GOT(extern_undeclared2)
 | 
						|
    GOT(inst2_extern_inline_postdeclared)
 | 
						|
    GOT(inst2_extern_inline_predeclared)
 | 
						|
    GOT(inst3_extern_inline_predeclared)
 | 
						|
    GOT(inst_extern_inline_postdeclared)
 | 
						|
    GOT(inst_extern_inline_predeclared)
 | 
						|
    GOT(main)
 | 
						|
    GOT(noinst_extern_inline_func)
 | 
						|
    GOT(noinst_extern_inline_postdeclared)
 | 
						|
    GOT(noinst_extern_inline_postdeclared2)
 | 
						|
    GOT(noinst_extern_inline_undeclared)
 | 
						|
 | 
						|
    // 0
 | 
						|
    GOT(noinst_static_inline_postdeclared)
 | 
						|
    GOT(noinst2_static_inline_postdeclared)
 | 
						|
    GOT(noinst_static_inline_predeclared)
 | 
						|
    GOT(noinst2_static_inline_predeclared)
 | 
						|
    GOT(static_func)
 | 
						|
}
 |