diff options
| author | Fangrui Song <maskray@google.com> | 2020-01-20 14:30:06 -0800 |
|---|---|---|
| committer | Fangrui Song <maskray@google.com> | 2020-01-24 10:38:40 -0800 |
| commit | 5d1fe1a1a9f18c5009e9e282b755e52c5e7ce5a2 (patch) | |
| tree | 91d714b21bc6223116db128f18b1ae1f2a2fd2a8 /clang/test/CodeGen/patchable-function-entry.c | |
| parent | 6f4edc606b2088bcac066640d5107d2042c203c1 (diff) | |
| download | bcm5719-llvm-5d1fe1a1a9f18c5009e9e282b755e52c5e7ce5a2.tar.gz bcm5719-llvm-5d1fe1a1a9f18c5009e9e282b755e52c5e7ce5a2.zip | |
[Driver][CodeGen] Support -fpatchable-function-entry=N,M and __attribute__((patchable_function_entry(N,M))) where M>0
Reviewed By: nickdesaulniers
Differential Revision: https://reviews.llvm.org/D73072
(cherry picked from commit 69bf40c45fd7f6dfe11b47de42571d8bff5ef94f)
Diffstat (limited to 'clang/test/CodeGen/patchable-function-entry.c')
| -rw-r--r-- | clang/test/CodeGen/patchable-function-entry.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/clang/test/CodeGen/patchable-function-entry.c b/clang/test/CodeGen/patchable-function-entry.c index 50b96ea883a..f41f12d0669 100644 --- a/clang/test/CodeGen/patchable-function-entry.c +++ b/clang/test/CodeGen/patchable-function-entry.c @@ -17,10 +17,20 @@ __attribute__((patchable_function_entry(2, 0))) void f20() {} __attribute__((patchable_function_entry(2, 0))) void f20decl(); void f20decl() {} -// OPT: define void @f() #2 +// CHECK: define void @f44() #2 +__attribute__((patchable_function_entry(4, 4))) void f44() {} + +// CHECK: define void @f52() #3 +__attribute__((patchable_function_entry(5, 2))) void f52() {} + +// OPT: define void @f() #4 void f() {} -/// M in patchable_function_entry(N,M) is currently ignored. -// CHECK: attributes #0 = { {{.*}} "patchable-function-entry"="0" +/// No need to emit "patchable-function-entry"="0" +// CHECK: attributes #0 = { {{.*}} +// CHECK-NOT: "patchable-function-entry" + // CHECK: attributes #1 = { {{.*}} "patchable-function-entry"="2" -// OPT: attributes #2 = { {{.*}} "patchable-function-entry"="1" +// CHECK: attributes #2 = { {{.*}} "patchable-function-entry"="0" "patchable-function-prefix"="4" +// CHECK: attributes #3 = { {{.*}} "patchable-function-entry"="3" "patchable-function-prefix"="2" +// OPT: attributes #4 = { {{.*}} "patchable-function-entry"="1" |

