Home | History | Annotate | Download | only in DataFlowSanitizer
      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 
      4 define i8 @add(i8 %a, i8 %b) {
      5   ; CHECK: @"dfs$add"
      6   ; CHECK-DAG: %[[ALABEL:.*]] = load{{.*}}__dfsan_arg_tls, i64 0, i64 0
      7   ; CHECK-DAG: %[[BLABEL:.*]] = load{{.*}}__dfsan_arg_tls, i64 0, i64 1
      8   ; CHECK: %[[UNION:.*]] = call{{.*}}__dfsan_union(i16 zeroext %[[ALABEL]], i16 zeroext %[[BLABEL]])
      9   ; CHECK: %[[ADDLABEL:.*]] = phi i16 [ %[[UNION]], {{.*}} ], [ %[[ALABEL]], {{.*}} ]
     10   ; CHECK: add i8
     11   ; CHECK: store i16 %[[ADDLABEL]], i16* @__dfsan_retval_tls
     12   ; CHECK: ret i8
     13   %c = add i8 %a, %b
     14   ret i8 %c
     15 }
     16 
     17 define i8 @sub(i8 %a, i8 %b) {
     18   ; CHECK: @"dfs$sub"
     19   ; CHECK: load{{.*}}__dfsan_arg_tls
     20   ; CHECK: load{{.*}}__dfsan_arg_tls
     21   ; CHECK: call{{.*}}__dfsan_union
     22   ; CHECK: sub i8
     23   ; CHECK: store{{.*}}__dfsan_retval_tls
     24   ; CHECK: ret i8
     25   %c = sub i8 %a, %b
     26   ret i8 %c
     27 }
     28 
     29 define i8 @mul(i8 %a, i8 %b) {
     30   ; CHECK: @"dfs$mul"
     31   ; CHECK: load{{.*}}__dfsan_arg_tls
     32   ; CHECK: load{{.*}}__dfsan_arg_tls
     33   ; CHECK: call{{.*}}__dfsan_union
     34   ; CHECK: mul i8
     35   ; CHECK: store{{.*}}__dfsan_retval_tls
     36   ; CHECK: ret i8
     37   %c = mul i8 %a, %b
     38   ret i8 %c
     39 }
     40 
     41 define i8 @sdiv(i8 %a, i8 %b) {
     42   ; CHECK: @"dfs$sdiv"
     43   ; CHECK: load{{.*}}__dfsan_arg_tls
     44   ; CHECK: load{{.*}}__dfsan_arg_tls
     45   ; CHECK: call{{.*}}__dfsan_union
     46   ; CHECK: sdiv i8
     47   ; CHECK: store{{.*}}__dfsan_retval_tls
     48   ; CHECK: ret i8
     49   %c = sdiv i8 %a, %b
     50   ret i8 %c
     51 }
     52 
     53 define i8 @udiv(i8 %a, i8 %b) {
     54   ; CHECK: @"dfs$udiv"
     55   ; CHECK: load{{.*}}__dfsan_arg_tls
     56   ; CHECK: load{{.*}}__dfsan_arg_tls
     57   ; CHECK: call{{.*}}__dfsan_union
     58   ; CHECK: udiv i8
     59   ; CHECK: store{{.*}}__dfsan_retval_tls
     60   ; CHECK: ret i8
     61   %c = udiv i8 %a, %b
     62   ret i8 %c
     63 }
     64