[NFC][AArch64] Explicitly define undefined bits for instructions (#122129)
[llvm-project.git] / compiler-rt / test / ubsan / TestCases / Integer / div-zero.cpp
blob0c18db5aa18daff61724d450fc9195f5a30ccb4b
1 // 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=integer-divide-by-zero -DDIVIDEND='intmax(123)' %s -o %t && %run %t 2>&1 | FileCheck %s
4 // RUN: %clangxx -fsanitize=float-divide-by-zero -DDIVIDEND=1.5 %s -o %t && %run %t 2>&1 | FileCheck %s
6 #if defined(__SIZEOF_INT128__) && !defined(_WIN32)
7 typedef __int128 intmax;
8 #else
9 typedef long long intmax;
10 #endif
12 int main() {
13 // CHECK: div-zero.cpp:[[@LINE+1]]:12: runtime error: division by zero
14 DIVIDEND / 0;