repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
RISC-V: Add testcases for unsigned imm vec SAT_SUB form2~4
[official-gcc.git]
/
gcc
/
testsuite
/
rust
/
execute
/
torture
/
cfg2.rs
blob
7b75ac6962fa47ba50d574a509633d3758275a38
1
// { dg-additional-options "-w -frust-cfg=A" }
2
// { dg-output "test1\r*\n" }
3
extern "C" {
4
fn printf(s: *const i8, ...);
5
}
6
7
fn test() {
8
#[cfg(A)]
9
unsafe {
10
let a = "test1\n\0";
11
let b = a as *const str;
12
let c = b as *const i8;
13
14
printf(c);
15
}
16
17
#[cfg(B)]
18
unsafe {
19
let a = "test2\n\0";
20
let b = a as *const str;
21
let c = b as *const i8;
22
23
printf(c);
24
}
25
}
26
27
fn main() -> i32 {
28
test();
29
30
0
31
}