Add InaccessibleMemOnly and inaccessibleMemOrArgMemOnly attributes
[oota-llvm.git] / test / Bitcode / compatibility.ll
index 73c24f0370a6528c45acab2537fae5f058a010e5..31e501de0a11f30bf773103230a7bf92d9556dbc 100644 (file)
@@ -503,6 +503,10 @@ declare void @f.kvpair() "cpu"="cortex-a8"
 ; CHECK:declare void @f.kvpair() #31
 declare void @f.norecurse() norecurse
 ; CHECK: declare void @f.norecurse() #32
+declare void @f.inaccessiblememonly() inaccessiblememonly
+; CHECK: declare void @f.inaccessiblememonly() #33
+declare void @f.inaccessiblemem_or_argmemonly() inaccessiblemem_or_argmemonly
+; CHECK: declare void @f.inaccessiblemem_or_argmemonly() #34
 
 ; Functions -- section
 declare void @f.section() section "80"
@@ -561,7 +565,7 @@ declare void @f.prologuearray() prologue [4 x i32] [i32 0, i32 1, i32 2, i32 3]
 
 ; Functions -- Personality constant
 declare void @llvm.donothing() nounwind readnone
-; CHECK: declare void @llvm.donothing() #33
+; CHECK: declare void @llvm.donothing() #35
 define void @f.no_personality() personality i8 3 {
 ; CHECK: define void @f.no_personality() personality i8 3
   invoke void @llvm.donothing() to label %normal unwind label %exception
@@ -664,6 +668,28 @@ define void @fastmathflags(float %op1, float %op2) {
   ret void
 }
 
+; Check various fast math flags and floating-point types on calls.
+
+declare float @fmf1()
+declare double @fmf2()
+declare <4 x double> @fmf3()
+
+; CHECK-LABEL: fastMathFlagsForCalls(
+define void @fastMathFlagsForCalls(float %f, double %d1, <4 x double> %d2) {
+  %call.fast = call fast float @fmf1()
+  ; CHECK: %call.fast = call fast float @fmf1()
+
+  ; Throw in some other attributes to make sure those stay in the right places.
+
+  %call.nsz.arcp = notail call nsz arcp double @fmf2()
+  ; CHECK: %call.nsz.arcp = notail call nsz arcp double @fmf2()
+
+  %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3()
+  ; CHECK: %call.nnan.ninf = tail call nnan ninf fastcc <4 x double> @fmf3()
+
+  ret void
+}
+
 ;; Type System
 %opaquety = type opaque
 define void @typesystem() {
@@ -769,95 +795,82 @@ define i32 @instructions.win_eh.1() personality i32 -3 {
 entry:
   %arg1 = alloca i32
   %arg2 = alloca i32
-  invoke void @f.ccc() to label %normal unwind label %catchpad1
-  invoke void @f.ccc() to label %normal unwind label %catchpad2
-  invoke void @f.ccc() to label %normal unwind label %catchpad3
+  invoke void @f.ccc() to label %normal unwind label %catchswitch1
+  invoke void @f.ccc() to label %normal unwind label %catchswitch2
+  invoke void @f.ccc() to label %normal unwind label %catchswitch3
 
-catchpad1:
-  catchpad [] to label %normal unwind label %exn.1
-  ; CHECK: catchpad []
-  ; CHECK-NEXT: to label %normal unwind label %exn.1
+catchswitch1:
+  %cs1 = catchswitch within none [label %catchpad1] unwind to caller
 
-catchpad2:
-  catchpad [i32* %arg1] to label %normal unwind label %exn.2
-  ; CHECK: catchpad [i32* %arg1]
-  ; CHECK-NEXT: to label %normal unwind label %exn.2
+catchpad1:
+  catchpad within %cs1 []
+  br label %normal
+  ; CHECK: catchpad within %cs1 []
+  ; CHECK-NEXT: br label %normal
 
-catchpad3:
-  catchpad [i32* %arg1, i32* %arg2] to label %normal unwind label %exn.3
-  ; CHECK: catchpad [i32* %arg1, i32* %arg2] 
-  ; CHECK-NEXT: to label %normal unwind label %exn.3
+catchswitch2:
+  %cs2 = catchswitch within none [label %catchpad2] unwind to caller
 
-exn.1:
-  catchendpad unwind label %terminate.1
-  ; CHECK: catchendpad unwind label %terminate.1
+catchpad2:
+  catchpad within %cs2 [i32* %arg1]
+  br label %normal
+  ; CHECK: catchpad within %cs2 [i32* %arg1]
+  ; CHECK-NEXT: br label %normal
 
-exn.2:
-  catchendpad unwind to caller
-  ; CHECK: catchendpad unwind to caller
+catchswitch3:
+  %cs3 = catchswitch within none [label %catchpad3] unwind label %cleanuppad1
 
-exn.3:
-  catchendpad unwind label %cleanuppad1
-  ; CHECK: catchendpad unwind label %cleanuppad1
+catchpad3:
+  catchpad within %cs3 [i32* %arg1, i32* %arg2]
+  br label %normal
+  ; CHECK: catchpad within %cs3 [i32* %arg1, i32* %arg2]
+  ; CHECK-NEXT: br label %normal
 
 cleanuppad1:
-  %clean.1 = cleanuppad []
-  ; CHECK: %clean.1 = cleanuppad []
-  invoke void @f.ccc() to label %normal unwind label %cleanupendpad1
-
-cleanupendpad1:
-  cleanupendpad %clean.1 unwind label %terminate.2
-  ; CHECK: cleanupendpad %clean.1 unwind label %terminate.2
-
-terminate.1:
-  terminatepad [] unwind to caller
-  ; CHECK: terminatepad [] unwind to caller
-
-terminate.2:
-  terminatepad [i32* %arg1] unwind label %normal.pre
-  ; CHECK: terminatepad [i32* %arg1] unwind label %normal.pre
-
-normal.pre:
-  terminatepad [i32* %arg1, i32* %arg2] unwind to caller
-  ; CHECK: terminatepad [i32* %arg1, i32* %arg2] unwind to caller
+  %clean.1 = cleanuppad within none []
+  unreachable
+  ; CHECK: %clean.1 = cleanuppad within none []
+  ; CHECK-NEXT: unreachable
 
 normal:
   ret i32 0
 }
-
+;
 define i32 @instructions.win_eh.2() personality i32 -4 {
 entry:
-  invoke void @f.ccc() to label %invoke.cont unwind label %catchpad
+  invoke void @f.ccc() to label %invoke.cont unwind label %catchswitch
 
 invoke.cont:
   invoke void @f.ccc() to label %continue unwind label %cleanup
 
 cleanup:
-  %clean = cleanuppad []
-  ; CHECK: %clean = cleanuppad []
-  cleanupret %clean unwind to caller
-  ; CHECK: cleanupret %clean unwind to caller
+  %clean = cleanuppad within none []
+  ; CHECK: %clean = cleanuppad within none []
+  cleanupret from %clean unwind to caller
+  ; CHECK: cleanupret from %clean unwind to caller
+
+catchswitch:
+  %cs = catchswitch within none [label %catchpad] unwind label %terminate
 
 catchpad:
-  %catch = catchpad [] to label %body unwind label %catchend
-  ; CHECK: %catch = catchpad []
-  ; CHECK-NEXT: to label %body unwind label %catchend
+  %catch = catchpad within %cs []
+  br label %body
+  ; CHECK: %catch = catchpad within %cs []
+  ; CHECK-NEXT: br label %body
 
 body:
-  invoke void @f.ccc() to label %continue unwind label %catchend
-  catchret %catch to label %return
-  ; CHECK: catchret %catch to label %return
+  invoke void @f.ccc() to label %continue unwind label %terminate
+  catchret from %catch to label %return
+  ; CHECK: catchret from %catch to label %return
 
 return:
   ret i32 0
 
-catchend:
-  catchendpad unwind label %terminate
-  ; CHECK: catchendpad unwind label %terminate
-
 terminate:
-  terminatepad [] unwind to caller
-  ; CHECK: terminatepad [] unwind to caller
+  cleanuppad within %cs []
+  unreachable
+  ; CHECK: cleanuppad within %cs []
+  ; CHECK-NEXT: unreachable
 
 continue:
   ret i32 0
@@ -1127,7 +1140,7 @@ exit:
   ; CHECK: select <2 x i1> <i1 true, i1 false>, <2 x i8> <i8 2, i8 3>, <2 x i8> <i8 3, i8 2>
 
   call void @f.nobuiltin() builtin
-  ; CHECK: call void @f.nobuiltin() #37
+  ; CHECK: call void @f.nobuiltin() #39
 
   call fastcc noalias i32* @f.noalias() noinline
   ; CHECK: call fastcc noalias i32* @f.noalias() #12
@@ -1144,6 +1157,13 @@ define void @instructions.call_musttail(i8* inalloca %val) {
   ret void
 }
 
+define void @instructions.call_notail() {
+  notail call void @f1()
+  ; CHECK: notail call void @f1()
+
+  ret void
+}
+
 define void @instructions.landingpad() personality i32 -2 {
   invoke void @llvm.donothing() to label %proceed unwind label %catch1
   invoke void @llvm.donothing() to label %proceed unwind label %catch2
@@ -1500,11 +1520,13 @@ normal:
 ; CHECK: attributes #30 = { uwtable }
 ; CHECK: attributes #31 = { "cpu"="cortex-a8" }
 ; CHECK: attributes #32 = { norecurse }
-; CHECK: attributes #33 = { nounwind readnone }
-; CHECK: attributes #34 = { nounwind readonly argmemonly }
-; CHECK: attributes #35 = { nounwind argmemonly }
-; CHECK: attributes #36 = { nounwind readonly }
-; CHECK: attributes #37 = { builtin }
+; CHECK: attributes #33 = { inaccessiblememonly }
+; CHECK: attributes #34 = { inaccessiblemem_or_argmemonly }
+; CHECK: attributes #35 = { nounwind readnone }
+; CHECK: attributes #36 = { argmemonly nounwind readonly }
+; CHECK: attributes #37 = { argmemonly nounwind }
+; CHECK: attributes #38 = { nounwind readonly }
+; CHECK: attributes #39 = { builtin }
 
 ;; Metadata