mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-11-04 05:17:07 +00:00 
			
		
		
		
	the condition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18816 91177308-0d34-0410-b5e6-96231b3b80d8
		
			
				
	
	
		
			23 lines
		
	
	
		
			419 B
		
	
	
	
		
			LLVM
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			419 B
		
	
	
	
		
			LLVM
		
	
	
	
	
	
; RUN: llvm-as < %s | opt -globalopt -instcombine | llvm-dis | grep 'ret bool true'
 | 
						|
 | 
						|
;; check that global opt turns integers that only hold 0 or 1 into bools.
 | 
						|
 | 
						|
%G = internal global int 0    ;; This only holds 0 or 1.
 | 
						|
 | 
						|
implementation
 | 
						|
 | 
						|
void %set1() {
 | 
						|
	store int 0, int* %G
 | 
						|
	ret void
 | 
						|
}
 | 
						|
void %set2() {
 | 
						|
	store int 1, int* %G
 | 
						|
	ret void
 | 
						|
}
 | 
						|
 | 
						|
bool %get() {
 | 
						|
	%A = load int* %G
 | 
						|
	%C = setlt int %A, 2  ;; always true
 | 
						|
	ret bool %C
 | 
						|
}
 |