1 // RUN: %clang_cc1 -triple le32-unknown-nacl %s -emit-llvm -o - | FileCheck %s
3 // Basic argument/attribute tests for le32/PNaCl
5 // CHECK-LABEL: define void @f0(i32 %i, i32 %j, double %k)
6 void f0(int i, long j, double k) {}
12 // Structs should be passed byval and not split up
13 // CHECK-LABEL: define void @f1(%struct.s1* byval %i)
19 // Structs should be returned sret and not simplified by the frontend
20 // CHECK-LABEL: define void @f2(%struct.s2* noalias sret %agg.result)
26 // CHECK-LABEL: define void @f3(i64 %i)
27 void f3(long long i) {}
29 // i8/i16 should be signext, i32 and higher should not
30 // CHECK-LABEL: define void @f4(i8 signext %a, i16 signext %b)
31 void f4(char a, short b) {}
33 // CHECK-LABEL: define void @f5(i8 zeroext %a, i16 zeroext %b)
34 void f5(unsigned char a, unsigned short b) {}
42 // Enums should be treated as the underlying i32
43 // CHECK-LABEL: define void @f6(i32 %a)
44 void f6(enum my_enum a) {}
50 // Unions should be passed as byval structs
51 // CHECK-LABEL: define void @f7(%union.simple_union* byval %s)
52 void f7(union simple_union s) {}
59 // Bitfields should be passed as byval structs
60 // CHECK-LABEL: define void @f8(%struct.bitfield1* byval %bf1)
61 void f8(bitfield1 bf1) {}