xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/m64-ptr.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -emit-llvm -triple x86_64-apple-darwin -o - | FileCheck %s
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc // Make sure pointers are passed as pointers, not converted to int.
4*f4a2713aSLionel Sambuc // The first load should be of type i8** in either 32 or 64 bit mode.
5*f4a2713aSLionel Sambuc // This formerly happened on x86-64, 7375899.
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc class StringRef {
8*f4a2713aSLionel Sambuc public:
9*f4a2713aSLionel Sambuc   const char *Data;
10*f4a2713aSLionel Sambuc   long Len;
11*f4a2713aSLionel Sambuc };
12*f4a2713aSLionel Sambuc void foo(StringRef X);
bar(StringRef & A)13*f4a2713aSLionel Sambuc void bar(StringRef &A) {
14*f4a2713aSLionel Sambuc // CHECK: @_Z3barR9StringRef
15*f4a2713aSLionel Sambuc // CHECK: load i8**
16*f4a2713aSLionel Sambuc   foo(A);
17*f4a2713aSLionel Sambuc // CHECK: ret void
18*f4a2713aSLionel Sambuc }
19