]> git.proxmox.com Git - rustc.git/blobdiff - src/compiler-rt/test/ubsan/TestCases/Integer/sub-overflow.cpp
Imported Upstream version 1.6.0+dfsg1
[rustc.git] / src / compiler-rt / test / ubsan / TestCases / Integer / sub-overflow.cpp
index 15e64d95160354e102de4c15489ff4ad24828b79..54ec4b5cd3c662ad8912feeeb415848eb7f213b6 100644 (file)
@@ -1,6 +1,6 @@
-// RUN: %clangxx -DSUB_I32 -fsanitize=signed-integer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SUB_I32
-// RUN: %clangxx -DSUB_I64 -fsanitize=signed-integer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SUB_I64
-// RUN: %clangxx -DSUB_I128 -fsanitize=signed-integer-overflow %s -o %t && %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-SUB_I128
+// RUN: %clangxx -DSUB_I32 -fsanitize=signed-integer-overflow %s -o %t1 && %run %t1 2>&1 | FileCheck %s --check-prefix=CHECK-SUB_I32
+// RUN: %clangxx -DSUB_I64 -fsanitize=signed-integer-overflow %s -o %t2 && %run %t2 2>&1 | FileCheck %s --check-prefix=CHECK-SUB_I64
+// RUN: %clangxx -DSUB_I128 -fsanitize=signed-integer-overflow %s -o %t3 && %run %t3 2>&1 | FileCheck %s --check-prefix=CHECK-SUB_I128
 
 #include <stdint.h>
 #include <stdio.h>
@@ -21,7 +21,7 @@ int main() {
 #endif
 
 #ifdef SUB_I128
-# ifdef __SIZEOF_INT128__
+# if defined(__SIZEOF_INT128__) && !defined(_WIN32)
   (void)(-(__int128_t(1) << 126) - (__int128_t(1) << 126) - 1);
 # else
   puts("__int128 not supported");