diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2018-11-06 07:05:14 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2018-11-06 07:05:14 +0000 |
commit | d572cf496ded73d93306420b320100f5aead62b0 (patch) | |
tree | 21cfb891ab247a9bff291a3520c01e3c8e33419a /clang/test/CodeGen/builtins.c | |
parent | fb1e4465f14a4fcf8376a6c249bcdf86af915e69 (diff) | |
download | bcm5719-llvm-d572cf496ded73d93306420b320100f5aead62b0.tar.gz bcm5719-llvm-d572cf496ded73d93306420b320100f5aead62b0.zip |
os_log: Allow specifying mask type in format string.
A mask type is a 1 to 8-byte string that follows the "mask." annotation
in the format string. This enables obfuscating data in the event the
provided privacy level isn't enabled.
rdar://problem/36756282
llvm-svn: 346211
Diffstat (limited to 'clang/test/CodeGen/builtins.c')
-rw-r--r-- | clang/test/CodeGen/builtins.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/CodeGen/builtins.c b/clang/test/CodeGen/builtins.c index 40d7ca32d77..2506b2d4845 100644 --- a/clang/test/CodeGen/builtins.c +++ b/clang/test/CodeGen/builtins.c @@ -454,6 +454,22 @@ void test_builtin_os_log(void *buf, int i, const char *data) { // CHECK: call void @__os_log_helper_1_3_1_8_37( __builtin_os_log_format(buf, "%{ private, sensitive, private, public}s", "abc"); + + // CHECK: store volatile i32 22, i32* %[[LEN]], align 4 + len = __builtin_os_log_format_buffer_size("%{mask.xyz}s", "abc"); + + // CHECK: call void @__os_log_helper_1_2_2_8_112_8_34(i8* {{.*}}, i64 8026488 + __builtin_os_log_format(buf, "%{mask.xyz, public}s", "abc"); + + // CHECK: call void @__os_log_helper_1_3_2_8_112_4_1(i8* {{.*}}, i64 8026488 + __builtin_os_log_format(buf, "%{ mask.xyz, private }d", 11); + + // Mask type is silently ignored. + // CHECK: call void @__os_log_helper_1_2_1_8_32( + __builtin_os_log_format(buf, "%{ mask. xyz }s", "abc"); + + // CHECK: call void @__os_log_helper_1_2_1_8_32( + __builtin_os_log_format(buf, "%{ mask.xy z }s", "abc"); } // CHECK-LABEL: define linkonce_odr hidden void @__os_log_helper_1_3_4_4_0_8_34_4_17_8_49 |