1 ; Regression test for a compiler bug that caused a crash when instrumenting code
4 ; RUN: opt -S -aarch64-stack-tagging -stack-tagging-use-stack-safety=0 %s -o - | FileCheck %s
6 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
7 target triple = "aarch64"
9 define dso_local noundef i32 @_Z3bari(i32 noundef %0) sanitize_memtag {
10 %2 = alloca i32, align 4
11 store i32 %0, ptr %2, align 4
12 %3 = load i32, ptr %2, align 4
16 define dso_local noundef i32 @_Z3fooi(i32 noundef %0) sanitize_memtag {
17 %2 = alloca i32, align 4
18 %3 = alloca i32, align 4
19 store i32 %0, ptr %2, align 4
20 store volatile i32 5, ptr %3, align 4
21 %4 = load i32, ptr %2, align 4
22 %5 = load volatile i32, ptr %3, align 4
23 %6 = add nsw i32 %4, %5
24 ; CHECK: call void @llvm.aarch64.settag
25 ; CHECK: musttail call
26 ; CHECK-NOT: call void @llvm.aarch64.settag
27 %7 = musttail call noundef i32 @_Z3bari(i32 noundef %6)