Skip to content

Commit ebe7d94

Browse files
committed
add default testcase
1 parent 1cb4c8f commit ebe7d94

File tree

1 file changed

+44
-15
lines changed

1 file changed

+44
-15
lines changed

llvm/test/Transforms/Inline/PowerPC/inline-target-attr.ll

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,60 @@
44
target datalayout = "E-m:e-i64:64-n32:64"
55
target triple = "powerpc64le-ibm-linux-gnu"
66

7-
declare i32 @inlined()
7+
declare void @inlined()
88

9-
define i32 @foo() #0 {
10-
; CHECK-LABEL: foo
9+
define void @explicit() #0 {
10+
; CHECK-LABEL: explicit
1111
; CHECK: entry
12-
; CHECK-NEXT: call i32 @bar()
13-
; CHECK-NEXT: call i32 @inlined()
12+
; CHECK-NEXT: call void @not_compatible1()
13+
; CHECK-NEXT: call void @inlined()
1414
entry:
15-
%1 = call i32 @bar()
16-
%2 = call i32 @baz()
17-
%3 = add i32 %1, %2
18-
ret i32 %3
15+
call void @not_compatible1()
16+
call void @compatible1()
17+
ret void
1918
}
2019

21-
define i32 @bar() #1 {
20+
define void @not_compatible1() #1 {
2221
entry:
23-
%1 = call i32 @inlined()
24-
ret i32 %1
22+
call i32 @inlined()
23+
ret void
2524
}
2625

27-
define i32 @baz() #0 {
26+
define void @compatible1() #0 {
2827
entry:
29-
%1 = call i32 @inlined()
30-
ret i32 %1
28+
call void @inlined()
29+
ret void
3130
}
3231

32+
define void @default() #3 {
33+
; CHECK-LABEL: default
34+
; CHECK: entry
35+
; CHECK-NEXT: call void @not_compatible2()
36+
; CHECK-NEXT: call void @inlined()
37+
entry:
38+
call void @not_compatible2()
39+
call void @compatible2()
40+
ret void
41+
}
42+
43+
define void @not_compatible2() #4 {
44+
entry:
45+
call void @inlined()
46+
ret void
47+
}
48+
49+
define void @compatible2() #5 {
50+
entry:
51+
call void @inlined()
52+
ret void
53+
}
54+
55+
; explicit
3356
attributes #0 = { "target-cpu"="pwr7" "target-features"="+allow-unaligned-fp-access" }
3457
attributes #1 = { "target-cpu"="pwr7" "target-features"="-allow-unaligned-fp-access" }
58+
59+
; pwr7 by default implies +vsx
60+
attributes #3 = { "target-cpu"="pwr7" }
61+
attributes #4 = { "target-cpu"="pwr7" "target-features"="-vsx" }
62+
attributes #5 = { "target-cpu"="pwr7" "target-features"="+vsx" }
63+

0 commit comments

Comments
 (0)