1 // RUN: %clang_cc1 -Werror -triple i386-linux -emit-llvm -o - %s | FileCheck %s
3 // Test that different order of declarations is acceptable and that
4 // implementing different redeclarations is acceptable.
5 // rdar://problem/34949329
10 } TU __attribute__((transparent_union));
12 // CHECK-LABEL: define void @f0(i32 %tu.coerce)
13 // CHECK: %tu = alloca %union.TU, align 4
14 // CHECK: %coerce.dive = getelementptr inbounds %union.TU, %union.TU* %tu, i32 0, i32 0
15 // CHECK: store i32 %tu.coerce, i32* %coerce.dive, align 4
19 // CHECK-LABEL: define void @f1(i32 %tu.coerce)
20 // CHECK: %tu = alloca %union.TU, align 4
21 // CHECK: %coerce.dive = getelementptr inbounds %union.TU, %union.TU* %tu, i32 0, i32 0
22 // CHECK: store i32 %tu.coerce, i32* %coerce.dive, align 4
26 // CHECK-LABEL: define void @f2(i32 %i)
27 // CHECK: %i.addr = alloca i32, align 4
28 // CHECK: store i32 %i, i32* %i.addr, align 4
32 // CHECK-LABEL: define void @f3(i32 %i)
33 // CHECK: %i.addr = alloca i32, align 4
34 // CHECK: store i32 %i, i32* %i.addr, align 4
38 // Also test functions with parameters specified K&R style.
39 // CHECK-LABEL: define void @knrStyle(i32 %tu.coerce)
40 // CHECK: %tu = alloca %union.TU, align 4
41 // CHECK: %coerce.dive = getelementptr inbounds %union.TU, %union.TU* %tu, i32 0, i32 0
42 // CHECK: store i32 %tu.coerce, i32* %coerce.dive, align 4
44 void knrStyle(tu) TU tu; {}