]> granicus.if.org Git - clang/commitdiff
Oops, almost forgot the testcases.
authorMike Stump <mrs@apple.com>
Thu, 2 Apr 2009 01:14:26 +0000 (01:14 +0000)
committerMike Stump <mrs@apple.com>
Thu, 2 Apr 2009 01:14:26 +0000 (01:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68270 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/trapu.c [new file with mode: 0644]
test/CodeGen/trapv.c [new file with mode: 0644]

diff --git a/test/CodeGen/trapu.c b/test/CodeGen/trapu.c
new file mode 100644 (file)
index 0000000..640a6b1
--- /dev/null
@@ -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 (file)
index 0000000..c96488b
--- /dev/null
@@ -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;
+}