mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-31 08:16:47 +00:00 
			
		
		
		
	v2: continue iterating through the rest of the bb
    use for loop
v3: initialize FlattenCFG pass in ScalarOps
    add test
v4: split off initializing flattencfg to a separate patch
    add comment
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215574 91177308-0d34-0410-b5e6-96231b3b80d8
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			710 B
		
	
	
	
		
			LLVM
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			710 B
		
	
	
	
		
			LLVM
		
	
	
	
	
	
| ; RUN: opt -flattencfg -S < %s | FileCheck %s
 | |
| 
 | |
| 
 | |
| ; This test checks whether the pass completes without a crash.
 | |
| ; The code is not transformed in any way
 | |
| ;
 | |
| ; CHECK-LABEL: @test_not_crash
 | |
| define void @test_not_crash(i32 %in_a) #0 {
 | |
| entry:
 | |
|   %cmp0 = icmp eq i32 %in_a, -1
 | |
|   %cmp1 = icmp ne i32 %in_a, 0
 | |
|   %cond0 = and i1 %cmp0, %cmp1
 | |
|   br i1 %cond0, label %b0, label %b1
 | |
| 
 | |
| b0:                                ; preds = %entry
 | |
|   %cmp2 = icmp eq i32 %in_a, 0
 | |
|   %cmp3 = icmp ne i32 %in_a, 1
 | |
|   %cond1 = or i1 %cmp2, %cmp3
 | |
|   br i1 %cond1, label %exit, label %b1
 | |
| 
 | |
| b1:                                       ; preds = %entry, %b0
 | |
|   br label %exit
 | |
| 
 | |
| exit:                               ; preds = %entry, %b0, %b1
 | |
|   ret void
 | |
| }
 |