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 define i8 @add(i8 %a, i8 %b) {
7 ; CHECK-DAG: %[[#ALABEL:]] = load i8, ptr @__dfsan_arg_tls, align [[ALIGN:2]]
8 ; CHECK-DAG: %[[#BLABEL:]] = load i8, ptr inttoptr (i64 add (i64 ptrtoint (ptr @__dfsan_arg_tls to i64), i64 2) to ptr), align [[ALIGN]]
9 ; CHECK: %[[#UNION:]] = or i8 %[[#ALABEL]], %[[#BLABEL]]
10 ; CHECK: %c = add i8 %a, %b
11 ; CHECK: store i8 %[[#UNION]], ptr @__dfsan_retval_tls, align [[ALIGN]]
17 define i8 @sub(i8 %a, i8 %b) {
19 ; CHECK: load{{.*}}__dfsan_arg_tls
20 ; CHECK: load{{.*}}__dfsan_arg_tls
22 ; CHECK: %c = sub i8 %a, %b
23 ; CHECK: store{{.*}}__dfsan_retval_tls
29 define i8 @mul(i8 %a, i8 %b) {
31 ; CHECK: load{{.*}}__dfsan_arg_tls
32 ; CHECK: load{{.*}}__dfsan_arg_tls
34 ; CHECK: %c = mul i8 %a, %b
35 ; CHECK: store{{.*}}__dfsan_retval_tls
41 define i8 @sdiv(i8 %a, i8 %b) {
43 ; CHECK: load{{.*}}__dfsan_arg_tls
44 ; CHECK: load{{.*}}__dfsan_arg_tls
46 ; CHECK: %c = sdiv i8 %a, %b
47 ; CHECK: store{{.*}}__dfsan_retval_tls
53 define i8 @udiv(i8 %a, i8 %b) {
55 ; CHECK: load{{.*}}__dfsan_arg_tls
56 ; CHECK: load{{.*}}__dfsan_arg_tls
58 ; CHECK: %c = udiv i8 %a, %b
59 ; CHECK: store{{.*}}__dfsan_retval_tls
65 define double @fneg(double %a) {
67 ; CHECK: load{{.*}}__dfsan_arg_tls
68 ; CHECK: %c = fneg double %a
69 ; CHECK: store{{.*}}__dfsan_retval_tls
70 ; CHECK: ret double %c