aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-04-02 01:14:26 +0000
committerMike Stump <mrs@apple.com>2009-04-02 01:14:26 +0000
commit947b3e2c51393a2ac39b63f5a5d9e4ba43f05d6a (patch)
treeeb61a757381d2d63382013bedd6d426ef0a6a5ff
parent558cb56caf8906e0adbe643e3febbef0b7af1b9f (diff)
Oops, almost forgot the testcases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68270 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CodeGen/trapu.c10
-rw-r--r--test/CodeGen/trapv.c10
2 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGen/trapu.c b/test/CodeGen/trapu.c
new file mode 100644
index 0000000000..640a6b1b7c
--- /dev/null
+++ b/test/CodeGen/trapu.c
@@ -0,0 +1,10 @@
+// RUN: clang-cc -ftrapu %s -emit-llvm -o %t &&
+// RUN: grep "__overflow_handler" %t | count 3
+
+unsigned int ui, uj, uk;
+int i, j, k;
+
+void foo() {
+ ui = uj + uk;
+ i = j + k;
+}
diff --git a/test/CodeGen/trapv.c b/test/CodeGen/trapv.c
new file mode 100644
index 0000000000..c96488b8e9
--- /dev/null
+++ b/test/CodeGen/trapv.c
@@ -0,0 +1,10 @@
+// RUN: clang-cc -ftrapv %s -emit-llvm -o %t &&
+// RUN: grep "__overflow_handler" %t | count 2
+
+unsigned int ui, uj, uk;
+int i, j, k;
+
+void foo() {
+ ui = uj + uk;
+ i = j + k;
+}