]> git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/ubsan/TestCases/Integer/summary.cpp
Imported Upstream version 1.6.0+dfsg1
[rustc.git] / src / compiler-rt / test / ubsan / TestCases / Integer / summary.cpp
1 // RUN: %clangxx -fsanitize=integer %s -o %t
2 // RUN: %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOTYPE
3 // RUN: %env_ubsan_opts=report_error_type=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-TYPE
4 // REQUIRES: ubsan-asan
5
6 #include <stdint.h>
7
8 int main() {
9 (void)(uint64_t(10000000000000000000ull) + uint64_t(9000000000000000000ull));
10 // CHECK-NOTYPE: SUMMARY: AddressSanitizer: undefined-behavior {{.*}}summary.cpp:[[@LINE-1]]:44
11 // CHECK-TYPE: SUMMARY: AddressSanitizer: unsigned-integer-overflow {{.*}}summary.cpp:[[@LINE-2]]:44
12 return 0;
13 }