1*d32c0d14SRoman Lebedev // RUN: %clangxx -fsanitize=implicit-signed-integer-truncation %s -o %t
2*d32c0d14SRoman Lebedev // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOTYPE
3*d32c0d14SRoman Lebedev // RUN: %env_ubsan_opts=report_error_type=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-TYPE
4*d32c0d14SRoman Lebedev 
5*d32c0d14SRoman Lebedev #include <stdint.h>
6*d32c0d14SRoman Lebedev 
main()7*d32c0d14SRoman Lebedev int main() {
8*d32c0d14SRoman Lebedev   uint8_t t0 = int32_t(-1);
9*d32c0d14SRoman Lebedev   // CHECK-NOTYPE: SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior {{.*}}summary.cpp:[[@LINE-1]]:16
10*d32c0d14SRoman Lebedev   // CHECK-TYPE: SUMMARY: UndefinedBehaviorSanitizer: implicit-signed-integer-truncation {{.*}}summary.cpp:[[@LINE-2]]:16
11*d32c0d14SRoman Lebedev   return 0;
12*d32c0d14SRoman Lebedev }
13