1 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s
3 @addr = external global i64
5 define i64 @add_unsigned(i64 %x, i64 %y) {
6 ; CHECK: %z = add nuw i64 %x, %y
7 %z = add nuw i64 %x, %y
11 define i64 @sub_unsigned(i64 %x, i64 %y) {
12 ; CHECK: %z = sub nuw i64 %x, %y
13 %z = sub nuw i64 %x, %y
17 define i64 @mul_unsigned(i64 %x, i64 %y) {
18 ; CHECK: %z = mul nuw i64 %x, %y
19 %z = mul nuw i64 %x, %y
23 define i64 @add_signed(i64 %x, i64 %y) {
24 ; CHECK: %z = add nsw i64 %x, %y
25 %z = add nsw i64 %x, %y
29 define i64 @sub_signed(i64 %x, i64 %y) {
30 ; CHECK: %z = sub nsw i64 %x, %y
31 %z = sub nsw i64 %x, %y
35 define i64 @mul_signed(i64 %x, i64 %y) {
36 ; CHECK: %z = mul nsw i64 %x, %y
37 %z = mul nsw i64 %x, %y
41 define i64 @add_plain(i64 %x, i64 %y) {
42 ; CHECK: %z = add i64 %x, %y
47 define i64 @sub_plain(i64 %x, i64 %y) {
48 ; CHECK: %z = sub i64 %x, %y
53 define i64 @mul_plain(i64 %x, i64 %y) {
54 ; CHECK: %z = mul i64 %x, %y
59 define i64 @add_both(i64 %x, i64 %y) {
60 ; CHECK: %z = add nuw nsw i64 %x, %y
61 %z = add nuw nsw i64 %x, %y
65 define i64 @sub_both(i64 %x, i64 %y) {
66 ; CHECK: %z = sub nuw nsw i64 %x, %y
67 %z = sub nuw nsw i64 %x, %y
71 define i64 @mul_both(i64 %x, i64 %y) {
72 ; CHECK: %z = mul nuw nsw i64 %x, %y
73 %z = mul nuw nsw i64 %x, %y
77 define i64 @add_both_reversed(i64 %x, i64 %y) {
78 ; CHECK: %z = add nuw nsw i64 %x, %y
79 %z = add nsw nuw i64 %x, %y
83 define i64 @sub_both_reversed(i64 %x, i64 %y) {
84 ; CHECK: %z = sub nuw nsw i64 %x, %y
85 %z = sub nsw nuw i64 %x, %y
89 define i64 @mul_both_reversed(i64 %x, i64 %y) {
90 ; CHECK: %z = mul nuw nsw i64 %x, %y
91 %z = mul nsw nuw i64 %x, %y
95 define i64 @sdiv_exact(i64 %x, i64 %y) {
96 ; CHECK: %z = sdiv exact i64 %x, %y
97 %z = sdiv exact i64 %x, %y
101 define i64 @sdiv_plain(i64 %x, i64 %y) {
102 ; CHECK: %z = sdiv i64 %x, %y
107 define i64 @add_both_ce() {
108 ; CHECK: ret i64 add nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
109 ret i64 add nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
112 define i64 @sub_both_ce() {
113 ; CHECK: ret i64 sub nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
114 ret i64 sub nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
117 define i64 @mul_both_ce() {
118 ; CHECK: ret i64 mul nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
119 ret i64 mul nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
122 define i64 @sdiv_exact_ce() {
123 ; CHECK: ret i64 sdiv exact (i64 ptrtoint (i64* @addr to i64), i64 91)
124 ret i64 sdiv exact (i64 ptrtoint (i64* @addr to i64), i64 91)