xref: /aosp_15_r20/external/llvm/test/CodeGen/Generic/ptr-annotate.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; PR15253
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker%struct.mystruct = type { i32 }
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker@.str = private unnamed_addr constant [4 x i8] c"sth\00", section "llvm.metadata"
8*9880d681SAndroid Build Coastguard Worker@.str1 = private unnamed_addr constant [4 x i8] c"t.c\00", section "llvm.metadata"
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workerdefine void @foo() {
11*9880d681SAndroid Build Coastguard Workerentry:
12*9880d681SAndroid Build Coastguard Worker  %m = alloca i8, align 4
13*9880d681SAndroid Build Coastguard Worker  %0 = call i8* @llvm.ptr.annotation.p0i8(i8* %m, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str1, i32 0, i32 0), i32 2)
14*9880d681SAndroid Build Coastguard Worker  store i8 1, i8* %0, align 4
15*9880d681SAndroid Build Coastguard Worker  ret void
16*9880d681SAndroid Build Coastguard Worker}
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerdeclare i8* @llvm.ptr.annotation.p0i8(i8*, i8*, i8*, i32) #1
19