33// RUN: %clang_cc1 -triple aarch64-pc-windows-msvc -fsanitize=thread -O2 -emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
44// RUN: %clang_cc1 -triple aarch64-pc-windows-msvc -fsanitize=address -O2 -emit-llvm -o - %s | FileCheck %s --check-prefix=SAN
55
6- /// The ifunc is emitted before its resolver.
76int foo (int ) __attribute__ ((ifunc ("foo_ifunc" )));
87
98static int f1 (int i ) {
@@ -42,10 +41,10 @@ void* goo_ifunc(void) {
4241void * hoo_ifunc (void ) { return 0 ; }
4342extern void hoo (int ) __attribute__ ((ifunc ("hoo_ifunc" )));
4443
45- /// No ifunc on Windows, lowerred to global pointers.
44+ /// ifunc on Windows is lowered to global pointers and an indirect call .
4645// CHECK: @global = dso_local global i32 0, align 4
4746// CHECK: {{.*}} = internal{{.*}}global{{.*}}poison, align 8
48- /// Register the contructor for initialisation.
47+ /// Register the constructor for initialisation.
4948// CHECK: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 10, ptr @{{.*}}, ptr null }]
5049
5150// CHECK-LABEL: @bar()
@@ -56,14 +55,11 @@ extern void hoo(int) __attribute__ ((ifunc("hoo_ifunc")));
5655// CHECK %0 = load ptr, ptr getelementptr inbounds ([3 x ptr], ptr @0, i32 0, i32 1), align 8
5756// CHECK call void %0()
5857
59- // CHECK: define internal void @{{.*}}() #[[#CONSTRUCTOR:]] {
60- // CHECK-DAG: attributes #[[#CONSTRUCTOR]] = {{{.*}} disable_sanitizer_instrumentation {{.*}}
58+ // CHECK: define internal void @{{.*}}()
6159
62- // SAN: define {{(dso_local )?}}noalias {{(noundef )?}}ptr @goo_ifunc() {{(local_unnamed_addr )?}}#[[#GOO_IFUNC:]] {
60+ // SAN: define {{(dso_local )?}}noalias {{(noundef )?}}ptr @goo_ifunc() {{(local_unnamed_addr )?}}
6361
64- // SAN: define {{(dso_local )?}}noalias {{(noundef )?}}ptr @hoo_ifunc() {{(local_unnamed_addr )?}}#[[#GOO_IFUNC]] {
62+ // SAN: define {{(dso_local )?}}noalias {{(noundef )?}}ptr @hoo_ifunc() {{(local_unnamed_addr )?}}
6563
66- // SAN: define internal {{(fastcc )?}}{{(noundef )?}}nonnull ptr @foo_ifunc() {{(unnamed_addr )?}}#[[#FOO_IFUNC:]] {
64+ // SAN: define internal {{(fastcc )?}}{{(noundef )?}}nonnull ptr @foo_ifunc() {{(unnamed_addr )?}}
6765
68- // SAN-DAG: attributes #[[#GOO_IFUNC]] = {{{.*}} disable_sanitizer_instrumentation {{.*}}
69- // SAN-DAG: attributes #[[#FOO_IFUNC]] = {{{.*}} disable_sanitizer_instrumentation {{.*}}
0 commit comments