Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(808)

Side by Side Diff: test/CodeGen/emscripten-arguments.c

Issue 1696583002: Remove Emscripten support (Closed) Base URL: https://chromium.googlesource.com/a/native_client/pnacl-clang.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/Driver/ToolChains.h ('k') | test/CodeGen/emscripten-regparm.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // RUN: %clang_cc1 -triple asmjs-unknown-emscripten %s -emit-llvm -o - | FileChe ck %s
2
3 // Basic argument/attribute tests for asmjs/Emscripten
4
5 // CHECK: define void @f0(i32 %i, i32 %j, i64 %k, double %l, double %m)
6 void f0(int i, long j, long long k, double l, long double m) {}
7
8 typedef struct {
9 int aa;
10 int bb;
11 } s1;
12 // Structs should be passed byval and not split up.
13 // CHECK: define void @f1(%struct.s1* byval align 4 %i)
14 void f1(s1 i) {}
15
16 typedef struct {
17 int cc;
18 } s2;
19 // Single-element structs should be returned as the one element.
20 // CHECK: define i32 @f2()
21 s2 f2() {
22 s2 foo;
23 return foo;
24 }
25
26 typedef struct {
27 int cc;
28 int dd;
29 } s3;
30 // Structs should be returned sret and not simplified by the frontend.
31 // CHECK: define void @f3(%struct.s3* noalias sret %agg.result)
32 s3 f3() {
33 s3 foo;
34 return foo;
35 }
36
37 // CHECK: define void @f4(i64 %i)
38 void f4(long long i) {}
39
40 // i8/i16 should be signext, i32 and higher should not.
41 // CHECK: define void @f5(i8 signext %a, i16 signext %b)
42 void f5(char a, short b) {}
43
44 // CHECK: define void @f6(i8 zeroext %a, i16 zeroext %b)
45 void f6(unsigned char a, unsigned short b) {}
46
47
48 enum my_enum {
49 ENUM1,
50 ENUM2,
51 ENUM3,
52 };
53 // Enums should be treated as the underlying i32.
54 // CHECK: define void @f7(i32 %a)
55 void f7(enum my_enum a) {}
56
57 enum my_big_enum {
58 ENUM4 = 0xFFFFFFFFFFFFFFFF,
59 };
60 // Big enums should be treated as the underlying i64.
61 // CHECK: define void @f8(i64 %a)
62 void f8(enum my_big_enum a) {}
63
64 union simple_union {
65 int a;
66 char b;
67 };
68 // Unions should be passed as byval structs.
69 // CHECK: define void @f9(%union.simple_union* byval align 4 %s)
70 void f9(union simple_union s) {}
71
72 typedef struct {
73 int b4 : 4;
74 int b3 : 3;
75 int b8 : 8;
76 } bitfield1;
77 // Bitfields should be passed as byval structs.
78 // CHECK: define void @f10(%struct.bitfield1* byval align 4 %bf1)
79 void f10(bitfield1 bf1) {}
OLDNEW
« no previous file with comments | « lib/Driver/ToolChains.h ('k') | test/CodeGen/emscripten-regparm.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698