summaryrefslogtreecommitdiff
path: root/tests/codegen/fewer-names.rs
blob: 7f383a5c14979099094627b56d0eb84fbf5c1700 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// no-system-llvm
// compile-flags: -Coverflow-checks=no -O
// revisions: YES NO
// [YES]compile-flags: -Zfewer-names=yes
// [NO] compile-flags: -Zfewer-names=no
#![crate_type = "lib"]

#[no_mangle]
pub fn sum(x: u32, y: u32) -> u32 {
// YES-LABEL: define{{.*}}i32 @sum(i32 noundef %0, i32 noundef %1)
// YES-NEXT:    %3 = add i32 %1, %0
// YES-NEXT:    ret i32 %3

// NO-LABEL: define{{.*}}i32 @sum(i32 noundef %x, i32 noundef %y)
// NO-NEXT:  start:
// NO-NEXT:    %0 = add i32 %y, %x
// NO-NEXT:    ret i32 %0
    let z = x + y;
    z
}