brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · e332528 Raw
33 lines · cpp
1// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --include-generated-funcs --version 52// Basic C++ test for update_cc_test_checks3// RUN: %clang_cc1 -triple=x86_64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck %s4// RUN: %clang_cc1 -triple=x86_64-apple-macho -emit-llvm -o - %s | FileCheck %s --check-prefix=MACHO5// RUN: %clang_cc1 -triple=x86_64-windows-msvc -emit-llvm -o - %s | FileCheck %s --check-prefix=MSVC6// RUN: %clang_cc1 -triple=x86_64-windows-gnu -emit-llvm -o - %s | FileCheck %s --check-prefix=MINGW7 8class Foo {9  int x;10 11public:12  explicit Foo(int x);13  ~Foo();14  inline int function_defined_inline(int arg) const {15    return arg + x;16  }17  inline int function_defined_out_of_line(int arg) const;18};19 20[[clang::noinline]] static int static_noinline_fn(int arg) { return arg; }21 22Foo::Foo(int x) : x(x) {}23Foo::~Foo() {}24int Foo::function_defined_out_of_line(int arg) const { return x - arg; }25 26// Call the inline methods to ensure the LLVM IR is generated:27int main() {28  Foo f(1);29  f.function_defined_inline(2);30  f.function_defined_out_of_line(3);31  return static_noinline_fn(0);32}33