1 ; Test that the memcmpOptimizer works correctly
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
3 ; RUN: not grep {call.*memcmp}
4 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls -disable-output
6 declare int %memcmp(sbyte*,sbyte*,int)
7 %h = constant [2 x sbyte] c"h\00"
8 %hel = constant [4 x sbyte] c"hel\00"
9 %hello_u = constant [8 x sbyte] c"hello_u\00"
13 void %test(sbyte *%P, sbyte *%Q, int %N, int* %IP, bool *%BP) {
14 %A = call int %memcmp(sbyte *%P, sbyte* %P, int %N)
15 volatile store int %A, int* %IP
16 %B = call int %memcmp(sbyte *%P, sbyte* %Q, int 0)
17 volatile store int %B, int* %IP
18 %C = call int %memcmp(sbyte *%P, sbyte* %Q, int 1)
19 volatile store int %C, int* %IP
20 %D = call int %memcmp(sbyte *%P, sbyte* %Q, int 2)
22 volatile store bool %E, bool* %BP