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