blob: b244e80962c8f097e5a5e0f76065f74533e7dbc5 [file] [log] [blame]
//===-- main.cpp ------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// In this test, we define struct that exist might exist at the different
// levels in the code and test that we can properly locate these types with
// a varienty of different expressions.
namespace a {
struct namespace_only {
int a;
};
struct namespace_and_file {
int aa;
};
struct contains_type {
struct in_contains_type {
int aaa;
};
};
};
namespace b {
struct namespace_only {
int b;
};
struct namespace_and_file {
int bb;
};
struct contains_type {
struct in_contains_type {
int bbb;
};
};
};
struct namespace_and_file {
int ff;
};
struct contains_type {
struct in_contains_type {
int fff;
};
};
int main (int argc, char const *argv[]) {
a::namespace_only a_namespace_only = { 1 };
a::namespace_and_file a_namespace_and_file = { 2 };
a::contains_type::in_contains_type a_in_contains_type = { 3 };
b::namespace_only b_namespace_only = { 11 };
b::namespace_and_file b_namespace_and_file = { 22 };
b::contains_type::in_contains_type b_in_contains_type = { 33 };
namespace_and_file file_namespace_and_file = { 44 };
contains_type::in_contains_type file_in_contains_type = { 55 };
int i = 123; // Provide an integer that can be used for casting
// Take address of "i" to ensure it is in memory
if (&i == &argc) {
i = -1;
}
return i == -1; // Set a breakpoint here
}