1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
3 ; RUN: opt < %s -mtriple=avr-linux -passes=instcombine -S | FileCheck %s --check-prefix=AVR
4 ; RUN: opt < %s -mtriple=msp430-freebsd -passes=instcombine -S | FileCheck %s --check-prefix=MSP430
5 ; REQUIRES: avr-registered-target,msp430-registered-target
7 ; Test that the puts to putchar transformation works correctly even for
8 ; targets with 16-bit int.
10 declare i16 @putchar(i16)
11 declare i16 @puts(ptr)
13 @empty = constant [1 x i8] c"\00"
15 define void @xform_puts(i16 %c) {
16 ; Transform puts("") to putchar("\n").
17 ; AVR-LABEL: @xform_puts(
18 ; AVR-NEXT: [[PUTCHAR:%.*]] = call addrspace(1) i16 @putchar(i16 10)
21 ; MSP430-LABEL: @xform_puts(
22 ; MSP430-NEXT: [[PUTCHAR:%.*]] = call i16 @putchar(i16 10)
23 ; MSP430-NEXT: ret void
25 call i16 @puts(ptr @empty)