| ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py |
| ; |
| ; RUN: opt < %s -mtriple=avr-linux -passes=instcombine -S | FileCheck %s |
| ; RUN: opt < %s -mtriple=msp430-freebsd -passes=instcombine -S | FileCheck %s |
| ; |
| ; Test that the puts to putchar transformation works correctly even for |
| ; targets with 16-bit int. |
| |
| declare i16 @putchar(i16) |
| declare i16 @puts(ptr) |
| |
| @empty = constant [1 x i8] c"\00" |
| |
| define void @xform_puts(i16 %c) { |
| ; CHECK-LABEL: @xform_puts( |
| ; CHECK-NEXT: [[PUTCHAR:%.*]] = call i16 @putchar(i16 10) |
| ; CHECK-NEXT: ret void |
| ; |
| ; Transform puts("") to putchar("\n"). |
| call i16 @puts(ptr @empty) |
| |
| ret void |
| } |