Daniel Dunbar | 17d3fea | 2011-02-09 17:54:19 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple i386-unknown-unknown -mregparm 4 %s -emit-llvm -o %t |
| 2 | // RUN: FileCheck < %t %s |
| 3 | |
| 4 | void f1(int a, int b, int c, int d, |
| 5 | int e, int f, int g, int h); |
| 6 | |
Eli Friedman | a49218e | 2011-04-09 08:18:08 +0000 | [diff] [blame] | 7 | void f2(int a, int b) __attribute((regparm(0))); |
| 8 | |
Daniel Dunbar | 17d3fea | 2011-02-09 17:54:19 +0000 | [diff] [blame] | 9 | void f0() { |
| 10 | // CHECK: call void @f1(i32 inreg 1, i32 inreg 2, i32 inreg 3, i32 inreg 4, |
| 11 | // CHECK: i32 5, i32 6, i32 7, i32 8) |
| 12 | f1(1, 2, 3, 4, 5, 6, 7, 8); |
Eli Friedman | a49218e | 2011-04-09 08:18:08 +0000 | [diff] [blame] | 13 | // CHECK: call void @f2(i32 1, i32 2) |
| 14 | f2(1, 2); |
Daniel Dunbar | 17d3fea | 2011-02-09 17:54:19 +0000 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | // CHECK: declare void @f1(i32 inreg, i32 inreg, i32 inreg, i32 inreg, |
| 18 | // CHECK: i32, i32, i32, i32) |
Eli Friedman | a49218e | 2011-04-09 08:18:08 +0000 | [diff] [blame] | 19 | // CHECK: declare void @f2(i32, i32) |
Daniel Dunbar | 17d3fea | 2011-02-09 17:54:19 +0000 | [diff] [blame] | 20 | |