annotate test/Transforms/InstCombine/wcslen-4.ll @ 121:803732b1fca8

LLVM 5.0
author kono
date Fri, 27 Oct 2017 17:07:41 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; Test that the wcslen library call simplifier works correctly.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 ; RUN: opt < %s -instcombine -S | FileCheck %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 ; Without the wchar_size metadata we should see no optimization happening.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 @hello = constant [6 x i32] [i32 104, i32 101, i32 108, i32 108, i32 111, i32 0]
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 declare i64 @wcslen(i32*)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 define i64 @test_no_simplify1() {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 ; CHECK-LABEL: @test_no_simplify1(
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 ; CHECK-NEXT: %hello_l = call i64 @wcslen(i32* getelementptr inbounds ([6 x i32], [6 x i32]* @hello, i64 0, i64 0))
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16 ; CHECK-NEXT: ret i64 %hello_l
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 %hello_p = getelementptr [6 x i32], [6 x i32]* @hello, i64 0, i64 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 %hello_l = call i64 @wcslen(i32* %hello_p)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 ret i64 %hello_l
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 }