25 lines
705 B
LLVM
25 lines
705 B
LLVM
; 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(i8*)
|
|
|
|
@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").
|
|
%s = getelementptr [1 x i8], [1 x i8]* @empty, i32 0, i32 0
|
|
call i16 @puts(i8* %s)
|
|
|
|
ret void
|
|
}
|