2013-08-08 06:47:18 +08:00
|
|
|
; RUN: opt < %s -dfsan -S | FileCheck %s
|
|
|
|
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"
|
2014-12-06 06:32:30 +08:00
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
2013-08-08 06:47:18 +08:00
|
|
|
|
|
|
|
define i8 @add(i8 %a, i8 %b) {
|
2013-08-23 04:08:08 +08:00
|
|
|
; CHECK: @"dfs$add"
|
2013-08-24 02:45:06 +08:00
|
|
|
; CHECK-DAG: %[[ALABEL:.*]] = load{{.*}}__dfsan_arg_tls, i64 0, i64 0
|
|
|
|
; CHECK-DAG: %[[BLABEL:.*]] = load{{.*}}__dfsan_arg_tls, i64 0, i64 1
|
|
|
|
; CHECK: %[[UNION:.*]] = call{{.*}}__dfsan_union(i16 zeroext %[[ALABEL]], i16 zeroext %[[BLABEL]])
|
|
|
|
; CHECK: %[[ADDLABEL:.*]] = phi i16 [ %[[UNION]], {{.*}} ], [ %[[ALABEL]], {{.*}} ]
|
2013-08-08 06:47:18 +08:00
|
|
|
; CHECK: add i8
|
2013-08-24 02:45:06 +08:00
|
|
|
; CHECK: store i16 %[[ADDLABEL]], i16* @__dfsan_retval_tls
|
2013-08-08 06:47:18 +08:00
|
|
|
; CHECK: ret i8
|
|
|
|
%c = add i8 %a, %b
|
|
|
|
ret i8 %c
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8 @sub(i8 %a, i8 %b) {
|
2013-08-23 04:08:08 +08:00
|
|
|
; CHECK: @"dfs$sub"
|
2013-08-08 06:47:18 +08:00
|
|
|
; CHECK: load{{.*}}__dfsan_arg_tls
|
|
|
|
; CHECK: load{{.*}}__dfsan_arg_tls
|
|
|
|
; CHECK: call{{.*}}__dfsan_union
|
|
|
|
; CHECK: sub i8
|
|
|
|
; CHECK: store{{.*}}__dfsan_retval_tls
|
|
|
|
; CHECK: ret i8
|
|
|
|
%c = sub i8 %a, %b
|
|
|
|
ret i8 %c
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8 @mul(i8 %a, i8 %b) {
|
2013-08-23 04:08:08 +08:00
|
|
|
; CHECK: @"dfs$mul"
|
2013-08-08 06:47:18 +08:00
|
|
|
; CHECK: load{{.*}}__dfsan_arg_tls
|
|
|
|
; CHECK: load{{.*}}__dfsan_arg_tls
|
|
|
|
; CHECK: call{{.*}}__dfsan_union
|
|
|
|
; CHECK: mul i8
|
|
|
|
; CHECK: store{{.*}}__dfsan_retval_tls
|
|
|
|
; CHECK: ret i8
|
|
|
|
%c = mul i8 %a, %b
|
|
|
|
ret i8 %c
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8 @sdiv(i8 %a, i8 %b) {
|
2013-08-23 04:08:08 +08:00
|
|
|
; CHECK: @"dfs$sdiv"
|
2013-08-08 06:47:18 +08:00
|
|
|
; CHECK: load{{.*}}__dfsan_arg_tls
|
|
|
|
; CHECK: load{{.*}}__dfsan_arg_tls
|
|
|
|
; CHECK: call{{.*}}__dfsan_union
|
|
|
|
; CHECK: sdiv i8
|
|
|
|
; CHECK: store{{.*}}__dfsan_retval_tls
|
|
|
|
; CHECK: ret i8
|
|
|
|
%c = sdiv i8 %a, %b
|
|
|
|
ret i8 %c
|
|
|
|
}
|
|
|
|
|
|
|
|
define i8 @udiv(i8 %a, i8 %b) {
|
2013-08-23 04:08:08 +08:00
|
|
|
; CHECK: @"dfs$udiv"
|
2013-08-08 06:47:18 +08:00
|
|
|
; CHECK: load{{.*}}__dfsan_arg_tls
|
|
|
|
; CHECK: load{{.*}}__dfsan_arg_tls
|
|
|
|
; CHECK: call{{.*}}__dfsan_union
|
|
|
|
; CHECK: udiv i8
|
|
|
|
; CHECK: store{{.*}}__dfsan_retval_tls
|
|
|
|
; CHECK: ret i8
|
|
|
|
%c = udiv i8 %a, %b
|
|
|
|
ret i8 %c
|
|
|
|
}
|