Handle __builtin_extract_return_addr
Our architectures don't need anything special for this builtin, just pass through the argument.
This commit is contained in:
		
							parent
							
								
									fb933ae0eb
								
							
						
					
					
						commit
						ce55d03eef
					
				
					 2 changed files with 5 additions and 0 deletions
				
			
		
							
								
								
									
										3
									
								
								libtcc.c
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								libtcc.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -904,6 +904,9 @@ LIBTCCAPI TCCState *tcc_new(void)
 | 
			
		|||
# endif
 | 
			
		||||
#endif /* ndef TCC_TARGET_PE */
 | 
			
		||||
 | 
			
		||||
    /* Some GCC builtins that are simple to express as macros.  */
 | 
			
		||||
    tcc_define_symbol(s, "__builtin_extract_return_addr(x)", "x");
 | 
			
		||||
 | 
			
		||||
    return s;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3027,6 +3027,8 @@ void builtin_test(void)
 | 
			
		|||
    printf("bce: %d\n", i);
 | 
			
		||||
    i = sizeof (__builtin_choose_expr (0, ll, s));
 | 
			
		||||
    printf("bce: %d\n", i);
 | 
			
		||||
 | 
			
		||||
    printf("bera: %p\n", __builtin_extract_return_addr((void*)43));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#ifndef _WIN32
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue