Home | History | Annotate | Download | only in Hexagon
      1 ; RUN: llc -march=hexagon < %s | FileCheck %s
      2 
      3 ; CHECK: GCC_except_table0:
      4 ; CHECK: Call site Encoding = uleb128
      5 
      6 target triple = "hexagon"
      7 
      8 @g0 = external constant i8*
      9 
     10 define i32 @f0() #0 personality i8* bitcast (i32 (...)* @f3 to i8*) {
     11 b0:
     12   %v0 = alloca i32, align 4
     13   %v1 = alloca i32, align 4
     14   %v2 = alloca i8*
     15   %v3 = alloca i32
     16   %v4 = alloca i32, align 4
     17   store i32 0, i32* %v0
     18   store i32 1, i32* %v1, align 4
     19   %v5 = call i8* @f1(i32 4) #2
     20   %v6 = bitcast i8* %v5 to i32*
     21   store i32 20, i32* %v6
     22   invoke void @f2(i8* %v5, i8* bitcast (i8** @g0 to i8*), i8* null) #3
     23           to label %b6 unwind label %b1
     24 
     25 b1:                                               ; preds = %b0
     26   %v7 = landingpad { i8*, i32 }
     27           catch i8* bitcast (i8** @g0 to i8*)
     28   %v8 = extractvalue { i8*, i32 } %v7, 0
     29   store i8* %v8, i8** %v2
     30   %v9 = extractvalue { i8*, i32 } %v7, 1
     31   store i32 %v9, i32* %v3
     32   br label %b2
     33 
     34 b2:                                               ; preds = %b1
     35   %v10 = load i32, i32* %v3
     36   %v11 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @g0 to i8*)) #2
     37   %v12 = icmp eq i32 %v10, %v11
     38   br i1 %v12, label %b3, label %b5
     39 
     40 b3:                                               ; preds = %b2
     41   %v13 = load i8*, i8** %v2
     42   %v14 = call i8* @f4(i8* %v13) #2
     43   %v15 = bitcast i8* %v14 to i32*
     44   %v16 = load i32, i32* %v15, align 4
     45   store i32 %v16, i32* %v4, align 4
     46   store i32 2, i32* %v1, align 4
     47   call void @f5() #2
     48   br label %b4
     49 
     50 b4:                                               ; preds = %b3
     51   %v17 = load i32, i32* %v1, align 4
     52   ret i32 %v17
     53 
     54 b5:                                               ; preds = %b2
     55   %v18 = load i8*, i8** %v2
     56   %v19 = load i32, i32* %v3
     57   %v20 = insertvalue { i8*, i32 } undef, i8* %v18, 0
     58   %v21 = insertvalue { i8*, i32 } %v20, i32 %v19, 1
     59   resume { i8*, i32 } %v21
     60 
     61 b6:                                               ; preds = %b0
     62   unreachable
     63 }
     64 
     65 declare i8* @f1(i32)
     66 
     67 declare void @f2(i8*, i8*, i8*)
     68 
     69 declare i32 @f3(...)
     70 
     71 ; Function Attrs: nounwind readnone
     72 declare i32 @llvm.eh.typeid.for(i8*) #1
     73 
     74 declare i8* @f4(i8*)
     75 
     76 declare void @f5()
     77 
     78 attributes #0 = { "no-frame-pointer-elim"="true" }
     79 attributes #1 = { nounwind readnone }
     80 attributes #2 = { nounwind }
     81 attributes #3 = { noreturn }
     82