summaryrefslogtreecommitdiff
path: root/test/ubsan_minimal/TestCases/uadd-overflow.cpp
blob: 0345750123250d99ec198bd3efa48324555cb50f (plain)
1
2
3
4
5
6
7
8
9
10
// RUN: %clangxx -fsanitize=unsigned-integer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s
// RUN: %clangxx -fsanitize=unsigned-integer-overflow -fno-sanitize-recover=all %s -o %t && not --crash %run %t 2>&1 | FileCheck %s

#include <stdint.h>

int main() {
  uint32_t k = 0x87654321;
  k += 0xedcba987;
  // CHECK: add-overflow
}