brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 18d9b4c Raw
35 lines · plain
1; RUN: opt < %s -passes='rtsan' -S | FileCheck %s2 3define void @violation() #0 {4  %1 = alloca ptr, align 85  %2 = call ptr @malloc(i64 noundef 2) #36  store ptr %2, ptr %1, align 87  ret void8}9 10declare ptr @malloc(i64 noundef) #111 12define noundef i32 @main() #2 {13  %1 = alloca i32, align 414  store i32 0, ptr %1, align 415  call void @violation() #416  ret i32 017}18 19attributes #0 = { mustprogress noinline sanitize_realtime optnone ssp uwtable(sync) }20 21; RealtimeSanitizer pass should insert call to initialize the runtime22; CHECK: @llvm.used = appending global [1 x ptr] [ptr @rtsan.module_ctor]23; CHECK: @llvm.global_ctors = {{.*}}@rtsan.module_ctor24 25; RealtimeSanitizer pass should insert __rtsan_realtime_enter right after function definition26; CHECK-LABEL: @violation()27; CHECK-NEXT: call{{.*}}@__rtsan_realtime_enter28 29; RealtimeSanitizer pass should insert __rtsan_realtime_exit right before function return30; CHECK: call{{.*}}@__rtsan_realtime_exit31; CHECK-NEXT: ret{{.*}}void32 33; CHECK-LABEL: define internal void @rtsan.module_ctor()34; CHECK-NEXT: call void @__rtsan_ensure_initialized()35