def : CompatRule<"isEqual<SanitizeAddressAttr>">;
def : CompatRule<"isEqual<SanitizeThreadAttr>">;
def : CompatRule<"isEqual<SanitizeMemoryAttr>">;
+def : CompatRule<"isEqual<SafeStackAttr>">;
class MergeRule<string F> {
// The name of the function called to merge the attributes of the caller and
ret i32 %i
}
+define i32 @safestack_callee(i32 %i) safestack {
+ ret i32 %i
+}
+
define i32 @alwaysinline_callee(i32 %i) alwaysinline {
ret i32 %i
}
ret i32 %i
}
+define i32 @alwaysinline_safestack_callee(i32 %i) alwaysinline safestack {
+ ret i32 %i
+}
+
; Check that:
; * noattr callee is inlined into noattr caller,
; CHECK-NEXT: ret i32
}
+define i32 @test_safestack(i32 %arg) safestack {
+ %x1 = call i32 @noattr_callee(i32 %arg)
+ %x2 = call i32 @safestack_callee(i32 %x1)
+ %x3 = call i32 @alwaysinline_callee(i32 %x2)
+ %x4 = call i32 @alwaysinline_safestack_callee(i32 %x3)
+ ret i32 %x4
+; CHECK-LABEL: @test_safestack(
+; CHECK-NEXT: @noattr_callee
+; CHECK-NEXT: ret i32
+}
+
; Check that a function doesn't get inlined if target-cpu strings don't match
; exactly.
define i32 @test_target_cpu_callee0(i32 %i) "target-cpu"="corei7" {