1 ; RUN: opt < %s -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 [64 x i16]
8 ; CHECK-LABEL: @__dfsan_retval_tls
9 ; CHECK: = external thread_local(initialexec) global i16
12 declare float @llvm.sqrt.f32(float)
14 ; CHECK-LABEL: @"dfs$call"
16 ; CHECK: store{{.*}}__dfsan_arg_tls
17 ; CHECK: call{{.*}}@"dfs$f"
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 i8* @__cxa_begin_catch(i8*)
33 declare void @__cxa_end_catch()
37 ; CHECK-LABEL: @"dfs$h"
38 ; CHECK: personality {{.*}} @"dfs$__gxx_personality_v0" {{.*}} {
39 define i32 @h() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
41 ; CHECK: invoke void (...) @"dfs$g"(i32 42)
42 invoke void (...) @g(i32 42)
43 to label %try.cont unwind label %lpad
46 %0 = landingpad { i8*, i32 }
48 %1 = extractvalue { i8*, i32 } %0, 0
50 ; CHECK: store {{.*}} @__dfsan_arg_tls
51 ; CHECK: call {{.*}} @"dfs$__cxa_begin_catch"
52 ; CHECK: load {{.*}} @__dfsan_retval_tls
53 %2 = tail call i8* @__cxa_begin_catch(i8* %1)
55 ; CHECK: call {{.*}} @"dfs$__cxa_end_catch"
56 tail call void @__cxa_end_catch()