aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr59333.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr59333.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr59333.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr59333.c b/gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr59333.c
new file mode 100644
index 000000000..b68775702
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr59333.c
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-options "-fsanitize=undefined" } */
+
+long long int __attribute__ ((noinline, noclone))
+foo (long long int i, long long int j)
+{
+ asm ("");
+ return i + j;
+}
+
+int
+main (void)
+{
+ foo (2LL, __LONG_LONG_MAX__);
+ return 0;
+}
+
+/* { dg-output "signed integer overflow: 2 \\+ 9223372036854775807 cannot be represented in type 'long long int'" } */