summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/ubsan/TestCases/Integer/summary.cpp
blob: 58432369226d4b679f6fbb744eeb49791bbf38b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// RUN: %clangxx -fsanitize=integer %s -o %t
// RUN: %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOTYPE
// RUN: %env_ubsan_opts=report_error_type=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-TYPE
// REQUIRES: ubsan-asan

#include <stdint.h>

int main() {
  (void)(uint64_t(10000000000000000000ull) + uint64_t(9000000000000000000ull));
  // CHECK-NOTYPE: SUMMARY: AddressSanitizer: undefined-behavior {{.*}}summary.cpp:[[@LINE-1]]:44
  // CHECK-TYPE: SUMMARY: AddressSanitizer: unsigned-integer-overflow {{.*}}summary.cpp:[[@LINE-2]]:44
  return 0;
}
OpenPOWER on IntegriCloud