|
7 | 7 | // RUN: %clang_cc1 -triple x86_64-apple-macosx -emit-llvm -o - %s | FileCheck %s
|
8 | 8 | // RUN: %clang_cc1 -triple arm64-apple-macosx -O2 -emit-llvm -o - %s | FileCheck %s
|
9 | 9 | // RUN: %clang_cc1 -triple x86_64-apple-macosx -O2 -emit-llvm -o - %s | FileCheck %s
|
10 |
| -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsanitize=thread -O2 -emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN |
11 |
| -// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=thread -O2 -emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN |
12 |
| -// RUN: %clang_cc1 -triple arm64-apple-macosx -fsanitize=address -O2 -emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN |
13 |
| -// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=address -O2 -emit-llvm -o - %s | FileCheck %s --check-prefix=MACSAN |
| 10 | +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsanitize=thread -O2 -emit-llvm -o - %s | FileCheck %s --check-prefix=SAN |
| 11 | +// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=thread -O2 -emit-llvm -o - %s | FileCheck %s --check-prefix=SAN |
| 12 | +// RUN: %clang_cc1 -triple arm64-apple-macosx -fsanitize=address -O2 -emit-llvm -o - %s | FileCheck %s --check-prefix=SAN |
| 13 | +// RUN: %clang_cc1 -triple x86_64-apple-macosx -fsanitize=address -O2 -emit-llvm -o - %s | FileCheck %s --check-prefix=SAN |
14 | 14 |
|
| 15 | +/// The ifunc is emitted before its resolver. |
15 | 16 | int foo(int) __attribute__ ((ifunc("foo_ifunc")));
|
16 | 17 |
|
17 | 18 | static int f1(int i) {
|
@@ -45,20 +46,24 @@ extern void goo(void) __attribute__ ((ifunc("goo_ifunc")));
|
45 | 46 | void* goo_ifunc(void) {
|
46 | 47 | return 0;
|
47 | 48 | }
|
| 49 | + |
| 50 | +/// The ifunc is emitted after its resolver. |
| 51 | +void *hoo_ifunc(void) { return 0; } |
| 52 | +extern void hoo(int) __attribute__ ((ifunc("hoo_ifunc"))); |
| 53 | + |
48 | 54 | // CHECK: @foo = ifunc i32 (i32), ptr @foo_ifunc
|
49 | 55 | // CHECK: @goo = ifunc void (), ptr @goo_ifunc
|
| 56 | +// CHECK: @hoo = ifunc void (i32), ptr @hoo_ifunc |
50 | 57 |
|
51 | 58 | // CHECK: call i32 @foo(i32
|
52 | 59 | // CHECK: call void @goo()
|
53 | 60 |
|
54 | 61 | // SAN: define internal nonnull {{(noundef )?}}ptr @foo_ifunc() #[[#FOO_IFUNC:]] {
|
55 |
| -// MACSAN: define internal nonnull {{(noundef )?}}ptr @foo_ifunc() #[[#FOO_IFUNC:]] { |
56 | 62 |
|
57 |
| -// SAN: define dso_local noalias {{(noundef )?}}ptr @goo_ifunc() #[[#GOO_IFUNC:]] { |
58 |
| -// MACSAN: define noalias {{(noundef )?}}ptr @goo_ifunc() #[[#GOO_IFUNC:]] { |
| 63 | +// SAN: define {{(dso_local )?}}noalias {{(noundef )?}}ptr @goo_ifunc() #[[#GOO_IFUNC:]] { |
59 | 64 |
|
60 |
| -// SAN-DAG: attributes #[[#FOO_IFUNC]] = {{{.*}} disable_sanitizer_instrumentation {{.*}} |
61 |
| -// MACSAN-DAG: attributes #[[#FOO_IFUNC]] = {{{.*}} disable_sanitizer_instrumentation {{.*}} |
| 65 | +// SAN: define {{(dso_local )?}}noalias {{(noundef )?}}ptr @hoo_ifunc() #[[#HOO_IFUNC:]] { |
62 | 66 |
|
| 67 | +// SAN-DAG: attributes #[[#FOO_IFUNC]] = {{{.*}} disable_sanitizer_instrumentation {{.*}} |
63 | 68 | // SAN-DAG: attributes #[[#GOO_IFUNC]] = {{{.*}} disable_sanitizer_instrumentation {{.*}}
|
64 |
| -// MACSAN-DAG: attributes #[[#GOO_IFUNC]] = {{{.*}} disable_sanitizer_instrumentation {{.*}} |
| 69 | +// SAN-DAG: attributes #[[#HOO_IFUNC]] = {{{.*}} disable_sanitizer_instrumentation {{.*}} |
0 commit comments