summaryrefslogtreecommitdiffstats
path: root/test/CodeGen/trapv.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/trapv.c')
-rw-r--r--test/CodeGen/trapv.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/test/CodeGen/trapv.c b/test/CodeGen/trapv.c
index f52dad5..bc8bc70 100644
--- a/test/CodeGen/trapv.c
+++ b/test/CodeGen/trapv.c
@@ -17,7 +17,8 @@ void test0() {
// CHECK-NEXT: [[T3:%.*]] = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 [[T1]], i32 [[T2]])
// CHECK-NEXT: [[T4:%.*]] = extractvalue { i32, i1 } [[T3]], 0
// CHECK-NEXT: [[T5:%.*]] = extractvalue { i32, i1 } [[T3]], 1
- // CHECK-NEXT: br i1 [[T5]]
+ // CHECK-NEXT: [[T6:%.*]] = xor i1 [[T5]], true
+ // CHECK-NEXT: br i1 [[T6]]
// CHECK: call void @llvm.trap()
i = j + k;
}
@@ -31,7 +32,8 @@ void test1() {
// CHECK-NEXT: [[T2:%.*]] = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 [[T1]], i32 1)
// CHECK-NEXT: [[T3:%.*]] = extractvalue { i32, i1 } [[T2]], 0
// CHECK-NEXT: [[T4:%.*]] = extractvalue { i32, i1 } [[T2]], 1
- // CHECK-NEXT: br i1 [[T4]]
+ // CHECK-NEXT: [[T5:%.*]] = xor i1 [[T4]], true
+ // CHECK-NEXT: br i1 [[T5]]
// CHECK: call void @llvm.trap()
}
@@ -44,6 +46,16 @@ void test2() {
// CHECK-NEXT: [[T2:%.*]] = call { i32, i1 } @llvm.sadd.with.overflow.i32(i32 [[T1]], i32 1)
// CHECK-NEXT: [[T3:%.*]] = extractvalue { i32, i1 } [[T2]], 0
// CHECK-NEXT: [[T4:%.*]] = extractvalue { i32, i1 } [[T2]], 1
- // CHECK-NEXT: br i1 [[T4]]
+ // CHECK-NEXT: [[T5:%.*]] = xor i1 [[T4]], true
+ // CHECK-NEXT: br i1 [[T5]]
// CHECK: call void @llvm.trap()
}
+
+// CHECK: define void @test3(
+void test3(int a, int b, float c, float d) {
+ // CHECK-NOT: @llvm.trap
+ (void)(a / b);
+ (void)(a % b);
+ (void)(c / d);
+ // CHECK: }
+}
OpenPOWER on IntegriCloud