summaryrefslogtreecommitdiff
path: root/src/msil/ch/epfl/lamp/compiler/msil/tests/CustomAttributesTest.java
blob: 5067489693846bc2d879308d4d71cb96a16a3773 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// $Id$

package ch.epfl.lamp.compiler.msil.tests;

import ch.epfl.lamp.compiler.msil.*;
import ch.epfl.lamp.compiler.msil.util.Table;

import java.io.PrintStream;

public class CustomAttributesTest {
    public static void main(String[] args) {
	if (args.length < 1) {
	    System.err.println("You must supply a filename!");
	    System.exit(1);
	}

	Assembly assem = Assembly.LoadFrom(args[0]);
	Type.initMSCORLIB(assem);

	testCustomAttributes();
    }

    public static void testCustomAttributes() {
	Object[] attrs = Type.GetType("System.ObsoleteAttribute")
	    .GetCustomAttributes(false);
	assert attrs != null;
	for (int i = 0; i < attrs.length; i++) {
	    System.out.println("\t" + attrs[i]);
	}
    }

}