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