blob: 68b01afab2181d3d6299bcfa15be1572829176ba [file] [log] [blame]
Stephen Hines2d1fdb22014-05-28 23:58:16 -07001// RUN: %clangxx -fsanitize=integer-divide-by-zero -DDIVIDEND=0 %s -o %t && %run %t 2>&1 | FileCheck %s
2// RUN: %clangxx -fsanitize=integer-divide-by-zero -DDIVIDEND=1U %s -o %t && %run %t 2>&1 | FileCheck %s
3// RUN: %clangxx -fsanitize=float-divide-by-zero -DDIVIDEND=1.5 %s -o %t && %run %t 2>&1 | FileCheck %s
4// RUN: %clangxx -fsanitize=integer-divide-by-zero -DDIVIDEND='intmax(123)' %s -o %t && %run %t 2>&1 | FileCheck %s
5
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -08006#if defined(__SIZEOF_INT128__) && !defined(_WIN32)
Stephen Hines2d1fdb22014-05-28 23:58:16 -07007typedef __int128 intmax;
8#else
9typedef long long intmax;
10#endif
11
12int main() {
13 // CHECK: div-zero.cpp:[[@LINE+1]]:12: runtime error: division by zero
14 DIVIDEND / 0;
15}