mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-30 16:17:05 +00:00 
			
		
		
		
	git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17536 91177308-0d34-0410-b5e6-96231b3b80d8
		
			
				
	
	
		
			38 lines
		
	
	
		
			660 B
		
	
	
	
		
			LLVM
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			660 B
		
	
	
	
		
			LLVM
		
	
	
	
	
	
| ; RUN: llvm-as -f %s -o %t.bc
 | |
| ; RUN: lli %t.bc > /dev/null
 | |
| 
 | |
| 
 | |
| void %test(sbyte* %P, short* %P, int* %P, long* %P) {
 | |
| 	%V = load sbyte* %P
 | |
| 	store sbyte %V, sbyte* %P
 | |
| 
 | |
| 	%V = load short* %P
 | |
| 	store short %V, short* %P
 | |
| 
 | |
| 	%V = load int* %P
 | |
| 	store int %V, int* %P
 | |
| 
 | |
| 	%V = load long* %P
 | |
| 	store long %V, long* %P
 | |
| 
 | |
| 	ret void
 | |
| }
 | |
| 
 | |
| uint %varalloca(uint %Size) {
 | |
| 	%X = alloca uint, uint %Size        ;; Variable sized alloca
 | |
| 	store uint %Size, uint* %X
 | |
| 	%Y = load uint* %X
 | |
| 	ret uint %Y
 | |
| }
 | |
| 
 | |
| int %main() {
 | |
| 	%A = alloca sbyte
 | |
| 	%B = alloca short
 | |
| 	%C = alloca int
 | |
| 	%D = alloca long
 | |
| 	call void %test(sbyte* %A, short* %B, int* %C, long* %D)
 | |
| 	call uint %varalloca(uint 7)
 | |
| 
 | |
| 	ret int 0
 | |
| }
 |