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

Side by Side Diff: test/Transforms/NaCl/expand-varargs-attrs.ll

Issue 14060026: PNaCl: Add NoAlias attributes in ExpandByVal and ExpandVarArgs passes (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Put noalias on the varargs function, not call Created 7 years, 8 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
OLDNEW
1 ; RUN: opt < %s -expand-varargs -S | FileCheck %s 1 ; RUN: opt < %s -expand-varargs -S | FileCheck %s
2 2
3 declare i32 @varargs_func(i32 %arg, ...) 3 declare i32 @varargs_func(i32 %arg, ...)
4 4
5 5
6 ; Check that attributes such as "byval" are preserved on fixed arguments. 6 ; Check that attributes such as "byval" are preserved on fixed arguments.
7 7
8 %MyStruct = type { i64, i64 } 8 %MyStruct = type { i64, i64 }
9 9
10 define void @func_with_arg_attrs(%MyStruct* byval, ...) { 10 define void @func_with_arg_attrs(%MyStruct* byval, ...) {
11 ret void 11 ret void
12 } 12 }
13 ; CHECK: define void @func_with_arg_attrs(%MyStruct* byval, i8* %varargs) { 13 ; CHECK: define void @func_with_arg_attrs(%MyStruct* byval, i8* noalias %varargs ) {
14 14
15 15
16 declare void @take_struct_arg(%MyStruct* byval %s, ...) 16 declare void @take_struct_arg(%MyStruct* byval %s, ...)
17 17
18 define void @call_with_arg_attrs(%MyStruct* %s) { 18 define void @call_with_arg_attrs(%MyStruct* %s) {
19 call void (%MyStruct*, ...)* @take_struct_arg(%MyStruct* byval %s) 19 call void (%MyStruct*, ...)* @take_struct_arg(%MyStruct* byval %s)
20 ret void 20 ret void
21 } 21 }
22 ; CHECK: define void @call_with_arg_attrs(%MyStruct* %s) { 22 ; CHECK: define void @call_with_arg_attrs(%MyStruct* %s) {
23 ; CHECK: call void %vararg_func(%MyStruct* byval %s, %vararg_call{{.*}} %vararg_ buffer) 23 ; CHECK: call void %vararg_func(%MyStruct* byval %s, %vararg_call{{.*}} %vararg_ buffer)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 ; reads space alloca'd by the caller. 63 ; reads space alloca'd by the caller.
64 define i32 @tail_call() { 64 define i32 @tail_call() {
65 %result = tail call i32 (i32, ...)* @varargs_func(i32 111, i64 222) 65 %result = tail call i32 (i32, ...)* @varargs_func(i32 111, i64 222)
66 ret i32 %result 66 ret i32 %result
67 } 67 }
68 ; CHECK: define i32 @tail_call() { 68 ; CHECK: define i32 @tail_call() {
69 ; CHECK: %result = call i32 %vararg_func(i32 111 69 ; CHECK: %result = call i32 %vararg_func(i32 111
70 70
71 71
72 ; CHECK: attributes #1 = { readonly } 72 ; CHECK: attributes #1 = { readonly }
OLDNEW
« test/Transforms/NaCl/expand-byval.ll ('K') | « test/Transforms/NaCl/expand-varargs.ll ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698