aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/Inputs/ctu-other.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/Inputs/ctu-other.c')
-rw-r--r--test/Analysis/Inputs/ctu-other.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/Analysis/Inputs/ctu-other.c b/test/Analysis/Inputs/ctu-other.c
new file mode 100644
index 000000000000..9a952061102f
--- /dev/null
+++ b/test/Analysis/Inputs/ctu-other.c
@@ -0,0 +1,49 @@
+// Test typedef and global variable in function.
+typedef struct {
+ int a;
+ int b;
+} FooBar;
+FooBar fb;
+int f(int i) {
+ if (fb.a) {
+ fb.b = i;
+ }
+ return 1;
+}
+
+// Test enums.
+enum B { x = 42,
+ l,
+ s };
+int enumCheck(void) {
+ return x;
+}
+
+// Test reporting an error in macro definition
+#define MYMACRO(ctx) \
+ ctx->a;
+struct S {
+ int a;
+};
+int g(struct S *ctx) {
+ MYMACRO(ctx);
+ return 0;
+}
+
+// Test that asm import does not fail.
+int inlineAsm() {
+ int res;
+ asm("mov $42, %0"
+ : "=r"(res));
+ return res;
+}
+
+// Implicit function.
+int identImplicit(int in) {
+ return in;
+}
+
+// ASTImporter doesn't support this construct.
+int structInProto(struct DataType {int a;int b; } * d) {
+ return 0;
+}