1 ; RUN: opt -passes=lint -disable-output %s 2>&1 | FileCheck %s
3 define <2 x i32> @use_vector_sdiv(<2 x i32> %a) nounwind {
4 %b = sdiv <2 x i32> %a, <i32 5, i32 8>
8 define <2 x i32> @use_vector_srem(<2 x i32> %a) nounwind {
9 %b = srem <2 x i32> %a, <i32 5, i32 8>
13 define <2 x i32> @use_vector_udiv(<2 x i32> %a) nounwind {
14 %b = udiv <2 x i32> %a, <i32 5, i32 8>
18 define <2 x i32> @use_vector_urem(<2 x i32> %a) nounwind {
19 %b = urem <2 x i32> %a, <i32 5, i32 8>
23 define i32 @use_sdiv_by_zero(i32 %a) nounwind {
24 ; CHECK: Undefined behavior: Division by zero
25 ; CHECK-NEXT: %b = sdiv i32 %a, 0
30 define i32 @use_sdiv_by_zeroinitializer(i32 %a) nounwind {
31 ; CHECK: Undefined behavior: Division by zero
32 ; CHECK-NEXT: %b = sdiv i32 %a, 0
33 %b = sdiv i32 %a, zeroinitializer
37 define <2 x i32> @use_vector_sdiv_by_zero_x(<2 x i32> %a) nounwind {
38 ; CHECK: Undefined behavior: Division by zero
39 ; CHECK-NEXT: %b = sdiv <2 x i32> %a, <i32 0, i32 5>
40 %b = sdiv <2 x i32> %a, <i32 0, i32 5>
44 define <2 x i32> @use_vector_sdiv_by_zero_y(<2 x i32> %a) nounwind {
45 ; CHECK: Undefined behavior: Division by zero
46 ; CHECK-NEXT: %b = sdiv <2 x i32> %a, <i32 4, i32 0>
47 %b = sdiv <2 x i32> %a, <i32 4, i32 0>
51 define <2 x i32> @use_vector_sdiv_by_zero_xy(<2 x i32> %a) nounwind {
52 ; CHECK: Undefined behavior: Division by zero
53 ; CHECK-NEXT: %b = sdiv <2 x i32> %a, zeroinitializer
54 %b = sdiv <2 x i32> %a, <i32 0, i32 0>
58 define <2 x i32> @use_vector_sdiv_by_undef_x(<2 x i32> %a) nounwind {
59 ; CHECK: Undefined behavior: Division by zero
60 ; CHECK-NEXT: %b = sdiv <2 x i32> %a, <i32 undef, i32 5>
61 %b = sdiv <2 x i32> %a, <i32 undef, i32 5>
65 define <2 x i32> @use_vector_sdiv_by_undef_y(<2 x i32> %a) nounwind {
66 ; CHECK: Undefined behavior: Division by zero
67 ; CHECK-NEXT: %b = sdiv <2 x i32> %a, <i32 5, i32 undef>
68 %b = sdiv <2 x i32> %a, <i32 5, i32 undef>
72 define <2 x i32> @use_vector_sdiv_by_undef_xy(<2 x i32> %a) nounwind {
73 ; CHECK: Undefined behavior: Division by zero
74 ; CHECK-NEXT: %b = sdiv <2 x i32> %a, undef
75 %b = sdiv <2 x i32> %a, <i32 undef, i32 undef>