mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-04 05:17:07 +00:00 
			
		
		
		
	input filename so that opt doesn't print the input filename in the output so that grep lines in the tests don't unintentionally match strings in the input filename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81537 91177308-0d34-0410-b5e6-96231b3b80d8
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			LLVM
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			LLVM
		
	
	
	
	
	
; RUN: opt < %s -simplify-libcalls -S > %t
 | 
						|
; RUN: not grep {call.*floor(} %t
 | 
						|
; RUN: grep {call.*floorf(} %t
 | 
						|
; RUN: not grep {call.*ceil(} %t
 | 
						|
; RUN: grep {call.*ceilf(} %t
 | 
						|
; RUN: not grep {call.*nearbyint(} %t
 | 
						|
; RUN: grep {call.*nearbyintf(} %t
 | 
						|
; XFAIL: sparc
 | 
						|
 | 
						|
declare double @floor(double)
 | 
						|
 | 
						|
declare double @ceil(double)
 | 
						|
 | 
						|
declare double @nearbyint(double)
 | 
						|
 | 
						|
define float @test_floor(float %C) {
 | 
						|
	%D = fpext float %C to double		; <double> [#uses=1]
 | 
						|
        ; --> floorf
 | 
						|
	%E = call double @floor( double %D )		; <double> [#uses=1]
 | 
						|
	%F = fptrunc double %E to float		; <float> [#uses=1]
 | 
						|
	ret float %F
 | 
						|
}
 | 
						|
 | 
						|
define float @test_ceil(float %C) {
 | 
						|
	%D = fpext float %C to double		; <double> [#uses=1]
 | 
						|
	; --> ceilf
 | 
						|
        %E = call double @ceil( double %D )		; <double> [#uses=1]
 | 
						|
	%F = fptrunc double %E to float		; <float> [#uses=1]
 | 
						|
	ret float %F
 | 
						|
}
 | 
						|
 | 
						|
define float @test_nearbyint(float %C) {
 | 
						|
	%D = fpext float %C to double		; <double> [#uses=1]
 | 
						|
	; --> nearbyintf
 | 
						|
        %E = call double @nearbyint( double %D )		; <double> [#uses=1]
 | 
						|
	%F = fptrunc double %E to float		; <float> [#uses=1]
 | 
						|
	ret float %F
 | 
						|
}
 | 
						|
 |