llvm-project/clang/test/CodeGenObjC/gnustep2-nontrivial-destructor-argument.mm
Fangrui Song c5de4dd1ea [test] %clang_cc1 -emit-llvm: remove redundant -S
And replace -emit-llvm -o - with -emit-llvm-only
2024-05-04 17:00:29 -07:00

23 lines
333 B
Plaintext

// RUN: %clang_cc1 -triple x86_64-unknow-windows-msvc -emit-llvm -fobjc-runtime=gnustep-2.0 -o - %s
// Regression test. Ensure that C++ arguments with non-trivial destructors
// don't crash the compiler.
struct X
{
int a;
~X();
};
@protocol Y
- (void)foo: (X)bar;
@end
void test(id<Y> obj)
{
X a{12};
[obj foo: a];
}