1 ; RUN: opt < %s -passes=dfsan -S | FileCheck %s
2 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
3 target triple = "x86_64-unknown-linux-gnu"
5 ; CHECK-LABEL: @__dfsan_arg_tls
6 ; CHECK: = external thread_local(initialexec) global [100 x i64]
8 ; CHECK-LABEL: @__dfsan_retval_tls
9 ; CHECK: = external thread_local(initialexec) global [100 x i64]
12 declare float @llvm.sqrt.f32(float)
14 ; CHECK-LABEL: @call.dfsan
16 ; CHECK: store{{.*}}__dfsan_arg_tls
17 ; CHECK: call{{.*}}@f.dfsan
18 ; CHECK: load{{.*}}__dfsan_retval_tls
19 %r = call i32 @f(i32 0)
21 ; CHECK-NOT: store{{.*}}__dfsan_arg_tls
22 %i = call float @llvm.sqrt.f32(float -1.0)
24 ; CHECK: store{{.*}}__dfsan_retval_tls
29 declare i32 @__gxx_personality_v0(...)
31 declare ptr @__cxa_begin_catch(ptr)
33 declare void @__cxa_end_catch()
37 ; CHECK-LABEL: @h.dfsan
38 ; CHECK: personality {{.*}} @__gxx_personality_v0.dfsan {
39 define i32 @h() personality ptr @__gxx_personality_v0 {
41 ; CHECK: invoke void (...) @g.dfsan(i32 42)
42 invoke void (...) @g(i32 42)
43 to label %try.cont unwind label %lpad
46 %0 = landingpad { ptr, i32 }
48 %1 = extractvalue { ptr, i32 } %0, 0
50 ; CHECK: store {{.*}} @__dfsan_arg_tls
51 ; CHECK: call {{.*}} @__cxa_begin_catch.dfsan
52 ; CHECK: load {{.*}} @__dfsan_retval_tls
53 %2 = tail call ptr @__cxa_begin_catch(ptr %1)
55 ; CHECK: call {{.*}} @__cxa_end_catch.dfsan
56 tail call void @__cxa_end_catch()