1
- // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=LINUX
1
+ // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=IFUNC-ELF
2
+ // RUN: %clang_cc1 -triple x86_64-pc-freebsd -emit-llvm %s -o - | FileCheck %s --check-prefix=IFUNC-ELF
2
3
// RUN: %clang_cc1 -triple x86_64-windows-pc -emit-llvm %s -o - | FileCheck %s --check-prefixes=NO-IFUNC,WINDOWS
3
- // RUN: %clang_cc1 -triple x86_64-fuchsia -emit-llvm %s -o - | FileCheck %s --check-prefixes=NO-IFUNC,FUCHSIA
4
+ // RUN: %clang_cc1 -triple x86_64-linux-musl -emit-llvm %s -o - | FileCheck %s --check-prefixes=NO-IFUNC,NO-IFUNC-ELF
5
+ // RUN: %clang_cc1 -triple x86_64-fuchsia -emit-llvm %s -o - | FileCheck %s --check-prefixes=NO-IFUNC,NO-IFUNC-ELF
4
6
int __attribute__((target ("sse4.2" ))) foo (int i , ...) { return 0 ; }
5
7
int __attribute__((target ("arch=sandybridge" ))) foo (int i , ...);
6
8
int __attribute__((target ("arch=ivybridge" ))) foo (int i , ...) {return 1 ;}
@@ -10,23 +12,23 @@ int bar(void) {
10
12
return foo (1 , 'a' , 1.1 ) + foo (2 , 2.2 , "asdf" );
11
13
}
12
14
13
- // LINUX : @foo.ifunc = weak_odr ifunc i32 (i32, ...), ptr @foo.resolver
14
- // LINUX : define{{.*}} i32 @foo.sse4.2(i32 noundef %i, ...)
15
- // LINUX : ret i32 0
16
- // LINUX : define{{.*}} i32 @foo.arch_ivybridge(i32 noundef %i, ...)
17
- // LINUX : ret i32 1
18
- // LINUX : define{{.*}} i32 @foo(i32 noundef %i, ...)
19
- // LINUX : ret i32 2
20
- // LINUX : define{{.*}} i32 @bar()
21
- // LINUX : call i32 (i32, ...) @foo.ifunc(i32 noundef 1, i32 noundef 97, double
22
- // LINUX : call i32 (i32, ...) @foo.ifunc(i32 noundef 2, double noundef 2.2{{[0-9Ee+]+}}, ptr noundef
15
+ // IFUNC-ELF : @foo.ifunc = weak_odr ifunc i32 (i32, ...), ptr @foo.resolver
16
+ // IFUNC-ELF : define{{.*}} i32 @foo.sse4.2(i32 noundef %i, ...)
17
+ // IFUNC-ELF : ret i32 0
18
+ // IFUNC-ELF : define{{.*}} i32 @foo.arch_ivybridge(i32 noundef %i, ...)
19
+ // IFUNC-ELF : ret i32 1
20
+ // IFUNC-ELF : define{{.*}} i32 @foo(i32 noundef %i, ...)
21
+ // IFUNC-ELF : ret i32 2
22
+ // IFUNC-ELF : define{{.*}} i32 @bar()
23
+ // IFUNC-ELF : call i32 (i32, ...) @foo.ifunc(i32 noundef 1, i32 noundef 97, double
24
+ // IFUNC-ELF : call i32 (i32, ...) @foo.ifunc(i32 noundef 2, double noundef 2.2{{[0-9Ee+]+}}, ptr noundef
23
25
24
- // LINUX : define weak_odr ptr @foo.resolver() comdat
25
- // LINUX : ret ptr @foo.arch_sandybridge
26
- // LINUX : ret ptr @foo.arch_ivybridge
27
- // LINUX : ret ptr @foo.sse4.2
28
- // LINUX : ret ptr @foo
29
- // LINUX : declare i32 @foo.arch_sandybridge(i32 noundef, ...)
26
+ // IFUNC-ELF : define weak_odr ptr @foo.resolver() comdat
27
+ // IFUNC-ELF : ret ptr @foo.arch_sandybridge
28
+ // IFUNC-ELF : ret ptr @foo.arch_ivybridge
29
+ // IFUNC-ELF : ret ptr @foo.sse4.2
30
+ // IFUNC-ELF : ret ptr @foo
31
+ // IFUNC-ELF : declare i32 @foo.arch_sandybridge(i32 noundef, ...)
30
32
31
33
// NO-IFUNC: define dso_local i32 @foo.sse4.2(i32 noundef %i, ...)
32
34
// NO-IFUNC: ret i32 0
@@ -39,10 +41,10 @@ int bar(void) {
39
41
// NO-IFUNC: call i32 (i32, ...) @foo.resolver(i32 noundef 2, double noundef 2.2{{[0-9Ee+]+}}, ptr noundef
40
42
41
43
// WINDOWS: define weak_odr dso_local i32 @foo.resolver(i32 %0, ...) comdat
42
- // FUCHSIA : define weak_odr i32 @foo.resolver(i32 %0, ...) comdat
44
+ // NO-IFUNC-ELF : define weak_odr i32 @foo.resolver(i32 %0, ...) comdat
43
45
// NO-IFUNC: musttail call i32 (i32, ...) @foo.arch_sandybridge
44
46
// NO-IFUNC: musttail call i32 (i32, ...) @foo.arch_ivybridge
45
47
// NO-IFUNC: musttail call i32 (i32, ...) @foo.sse4.2
46
48
// NO-IFUNC: musttail call i32 (i32, ...) @foo
47
49
// WINDOWS: declare dso_local i32 @foo.arch_sandybridge(i32 noundef, ...)
48
- // FUCHSIA : declare i32 @foo.arch_sandybridge(i32 noundef, ...)
50
+ // NO-IFUNC-ELF : declare i32 @foo.arch_sandybridge(i32 noundef, ...)
0 commit comments