aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr60636.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr60636.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr60636.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr60636.c b/gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr60636.c
new file mode 100644
index 000000000..416434137
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr60636.c
@@ -0,0 +1,15 @@
+/* PR sanitizer/60636 */
+/* { dg-do run } */
+/* { dg-options "-fsanitize=undefined" } */
+
+volatile long long int a;
+
+int
+main ()
+{
+ long long int u = -__LONG_LONG_MAX__ - 1;
+ a = u > 0 ? u : -u;
+ return 0;
+}
+
+/* { dg-output "negation of -9223372036854775808 cannot be represented in type 'long long int'" } */