aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/ubsan/pr81148.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/c-c++-common/ubsan/pr81148.c')
-rw-r--r--gcc/testsuite/c-c++-common/ubsan/pr81148.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/ubsan/pr81148.c b/gcc/testsuite/c-c++-common/ubsan/pr81148.c
new file mode 100644
index 00000000000..f2d46c8dc56
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/ubsan/pr81148.c
@@ -0,0 +1,9 @@
+/* { dg-do run } */
+/* { dg-options "-fsanitize=undefined -fsanitize-undefined-trap-on-error" } */
+
+int x = -106;
+int main()
+{
+ // -123 - (0x8000000000000000 - -1)
+ return (-123 - ((9223372036854775806LL ^ ~(x && 1)) - -1)) == 0;
+}