brintos

brintos / llvm-project-archived public Read only

0
0
Text · 650 B · 0c18db5 Raw
16 lines · cpp
1// RUN: %clangxx -fsanitize=integer-divide-by-zero -DDIVIDEND=0 %s -o %t && %run %t 2>&1 | FileCheck %s2// RUN: %clangxx -fsanitize=integer-divide-by-zero -DDIVIDEND=1U %s -o %t && %run %t 2>&1 | FileCheck %s3// RUN: %clangxx -fsanitize=integer-divide-by-zero -DDIVIDEND='intmax(123)' %s -o %t && %run %t 2>&1 | FileCheck %s4// RUN: %clangxx -fsanitize=float-divide-by-zero -DDIVIDEND=1.5 %s -o %t && %run %t 2>&1 | FileCheck %s5 6#if defined(__SIZEOF_INT128__) && !defined(_WIN32)7typedef __int128 intmax;8#else9typedef long long intmax;10#endif11 12int main() {13  // CHECK: div-zero.cpp:[[@LINE+1]]:12: runtime error: division by zero14  DIVIDEND / 0;15}16