summaryrefslogtreecommitdiff
path: root/test/ubsan/TestCases/ImplicitConversion/integer-truncation-blacklist.c
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2018-07-30 21:11:34 +0000
committerRoman Lebedev <lebedev.ri@gmail.com>2018-07-30 21:11:34 +0000
commit3eadc5926b0dc8a0a9479ca7e1cebbb414ff82ea (patch)
treeb2bf1c6ddc83af5aadbd94ace0edc0f9b4124a9e /test/ubsan/TestCases/ImplicitConversion/integer-truncation-blacklist.c
parent81eee417591e5679d09ceef4bce705b4fda2477e (diff)
[NFC] Rename test/ubsan/TestCases/{ImplicitCast => ImplicitConversion}
Just to be consistent with the rest. I should have done that in the commit itself, but the filepaths is one thing i forgot to verify :S git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@338307 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ubsan/TestCases/ImplicitConversion/integer-truncation-blacklist.c')
-rw-r--r--test/ubsan/TestCases/ImplicitConversion/integer-truncation-blacklist.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/ubsan/TestCases/ImplicitConversion/integer-truncation-blacklist.c b/test/ubsan/TestCases/ImplicitConversion/integer-truncation-blacklist.c
new file mode 100644
index 000000000..13d4dca4f
--- /dev/null
+++ b/test/ubsan/TestCases/ImplicitConversion/integer-truncation-blacklist.c
@@ -0,0 +1,20 @@
+// FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
+// I'm not sure this is actually *that* issue, but this seems oddly similar to the other XFAIL'ed cases.
+// XFAIL: android
+// UNSUPPORTED: ios
+
+// RUN: rm -f %tmp
+// RUN: echo "[implicit-integer-truncation]" >> %tmp
+// RUN: echo "fun:*implicitTruncation*" >> %tmp
+// RUN: %clang -fsanitize=implicit-integer-truncation -fno-sanitize-recover=implicit-integer-truncation -fsanitize-blacklist=%tmp -O0 %s -o %t && not %run %t 2>&1
+// RUN: %clang -fsanitize=implicit-integer-truncation -fno-sanitize-recover=implicit-integer-truncation -fsanitize-blacklist=%tmp -O1 %s -o %t && not %run %t 2>&1
+// RUN: %clang -fsanitize=implicit-integer-truncation -fno-sanitize-recover=implicit-integer-truncation -fsanitize-blacklist=%tmp -O2 %s -o %t && not %run %t 2>&1
+// RUN: %clang -fsanitize=implicit-integer-truncation -fno-sanitize-recover=implicit-integer-truncation -fsanitize-blacklist=%tmp -O3 %s -o %t && not %run %t 2>&1
+
+unsigned char implicitTruncation(unsigned int argc) {
+ return argc; // BOOM
+}
+
+int main(int argc, char **argv) {
+ return implicitTruncation(~0U);
+}