1 // RUN: %clang_cc1 -Werror -triple i386-linux -Wno-strict-prototypes -emit-llvm -o - %s | FileCheck %s
3 // Test that different order of declarations is acceptable and that
4 // implementing different redeclarations is acceptable.
9 } TU
__attribute__((transparent_union
));
11 // CHECK-LABEL: define{{.*}} void @f0(i32 %tu.coerce)
12 // CHECK: %tu = alloca %union.TU, align 4
13 // CHECK: %coerce.dive = getelementptr inbounds nuw %union.TU, ptr %tu, i32 0, i32 0
14 // CHECK: store i32 %tu.coerce, ptr %coerce.dive, align 4
18 // CHECK-LABEL: define{{.*}} void @f1(i32 noundef %tu.coerce)
19 // CHECK: %tu = alloca %union.TU, align 4
20 // CHECK: %coerce.dive = getelementptr inbounds nuw %union.TU, ptr %tu, i32 0, i32 0
21 // CHECK: store i32 %tu.coerce, ptr %coerce.dive, align 4
25 // CHECK-LABEL: define{{.*}} void @f2(i32 noundef %i)
26 // CHECK: %i.addr = alloca i32, align 4
27 // CHECK: store i32 %i, ptr %i.addr, align 4
31 // CHECK-LABEL: define{{.*}} void @f3(i32 noundef %i)
32 // CHECK: %i.addr = alloca i32, align 4
33 // CHECK: store i32 %i, ptr %i.addr, align 4
37 // Also test functions with parameters specified K&R style.
38 // CHECK-LABEL: define{{.*}} void @knrStyle(i32 noundef %tu.coerce)
39 // CHECK: %tu = alloca %union.TU, align 4
40 // CHECK: %coerce.dive = getelementptr inbounds nuw %union.TU, ptr %tu, i32 0, i32 0
41 // CHECK: store i32 %tu.coerce, ptr %coerce.dive, align 4
43 void knrStyle(tu
) TU tu
; {}