blob: 2b2b1ff8969e4c15fcab85d2ff0f9c1a2a05a032 [file] [log] [blame]
Anders Carlssonc8667a82009-05-19 20:40:02 +00001// RUN: clang-cc -verify -emit-llvm -o %t %s
2
3void t1() {
4 extern int& a;
5 int b = a;
6}
7
8void t2(int& a) {
9 int b = a;
10}
11
12int g;
13int& gr = g;
14void t3() {
15 int b = gr;
16}
Anders Carlsson4bbab922009-05-20 00:36:58 +000017
18// Test reference binding.
19
20struct C {};
21
22void f(const int&);
23void f(const _Complex int&);
24void f(const C&);
25
26void test_scalar() {
27 int a = 10;
28
29 f(a);
30}
31
32void test_complex() {
33 _Complex int a = 10i;
34
35 f(a);
36}
37
38void test_aggregate() {
39 C c;
40
41 f(c);
42}
43