File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -29,3 +29,18 @@ pub static tested_symbol: [u8; 6] = *b"foobar";
29
29
// DEFAULT: @{{.*}}default_hidden_visibility{{.*}}tested_symbol{{.*}} = constant
30
30
// YES: @{{.*}}default_hidden_visibility{{.*}}tested_symbol{{.*}} = hidden constant
31
31
// NO: @{{.*}}default_hidden_visibility{{.*}}tested_symbol{{.*}} = constant
32
+
33
+ pub fn do_memcmp ( left : & [ u8 ] , right : & [ u8 ] ) -> i32 {
34
+ left. cmp ( right) as i32
35
+ }
36
+
37
+ // CHECK: define {{.*}} @{{.*}}do_memcmp{{.*}} {
38
+ // CHECK: }
39
+
40
+ // `do_memcmp` should invoke core::intrinsic::compare_bytes which emits a call
41
+ // to the C symbol `memcmp` (at least on x86_64-unknown-linux-gnu). This symbol
42
+ // should *not* be `declare hidden`.
43
+
44
+ // DEFAULT: declare i32 @memcmp
45
+ // YES: declare i32 @memcmp
46
+ // NO: declare i32 @memcmp
Original file line number Diff line number Diff line change
1
+ //@ build-pass
2
+ //@ compile-flags: -Zdefault-hidden-visibility=yes
3
+
4
+ #![ crate_type = "dylib" ]
5
+
6
+ pub fn do_memcmp ( left : & [ u8 ] , right : & [ u8 ] ) -> i32 {
7
+ left. cmp ( right) as i32
8
+ }
You can’t perform that action at this time.
0 commit comments